I have the Xcode command line tools installed and can use clang++ fine for versions up to C++17. In Xcode itself, I can select C++20 in the build settings:
But when I try to compile using clang++ from the command line with this option:
error: invalid value 'c++20' in '-std=c++20'
note: use 'c++17' for 'ISO C++ 2017 with amendments' standard
note: use 'gnu++17' for 'ISO C++ 2017 with amendments and GNU extensions' standard
note: use 'c++2a' for 'Working draft for ISO C++ 2020' standard
note: use 'gnu++2a' for 'Working draft for ISO C++ 2020 with GNU extensions' standard
What would be the reason for this inconsistency? In case it matters:
~/ which clang++
/usr/bin/clang++
~/ clang++ -v
Apple clang version 11.0.3 (clang-1103.0.32.29)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
(I also tried clang -x c++).
