Skip to content

AppleClang: Add C++20 & 23 flags

Ghost User requested to merge (removed):ken-matsui-master-patch-69984 into master

It seems that CMake has no support for C++23 in Apple Clang, and I found the C++20 flag has been changed in Apple Clang 13. Therefore, I've added support for them.

clang++ --version
Apple clang version 13.0.0 (clang-1300.0.29.30)

Apple Clang 13 said to use the following flags even though it fully does not support C++20 ref:

note: use 'c++20' for 'ISO C++ 2020 DIS' standard
note: use 'gnu++20' for 'ISO C++ 2020 DIS with GNU extensions' standard
note: use 'c++2b' for 'Working draft for ISO C++ 2023 DIS' standard
note: use 'gnu++2b' for 'Working draft for ISO C++ 2023 DIS with GNU extensions' standard

Follow up !6174 (merged) with support for AppleClang.

Backport: release
Topic-rename: AppleClang-cxx20-cxx23-flags

Edited by Brad King

Merge request reports