missing clang builtins for source file location

The clang builtins for source file location (e.g. like __builtin_FILE()) don't seem to be present even with Xcode 11 beta.


They've been in clang++ upstream release for some time now. When will they be made available in Xcode Clang?


They can be used to implement a functional std::source_location even without C++20 library support, which while not a "show stopper", is certainly far superior to the tradition preprocessor based method of obtaining this information (hence its adoption in the standard).

Replies

What version of upstream clang++ are you looking at? Version 8, Version 9? Xcode 10 clang is derived from LLVM version 7.0, as far as I can tell. Apple clang is not one-to-one with released clang/LLVM versions, usually lags a version or two. Apple has proprietary changes to support its environment, and version upgrade usually occurs at Xcode major releases. So, it may get to version 8 when Xcode 11 is released. Remains to be seen.


You can always used a custom LLVM/clang toolchain with Xcode.