LLVM 16 default standard moved from C++14 to C++17

In December 2017, there was a proposal to switch the default dialect of C++ for LLVM/Clang from GNU++98 to GNU++14, which continued until the LLVM/Clang 15 release a few days ago. And  GCC has set the default standard to GNU++  17 in the GCC 11 version .

 GNU++ is the C++ language with GNU extensions. For GNU extension features, please refer to  GNU extensions to the C and C++ languages

After the release of LLVM 15.0 , a major change is coming to LLVM/Clang 16.0: GNU++17 will be the default C++ and ObjectiveC++ version of LLVM.

Clang's C++17 support is very stable, only minor details need to be fixed. In fact, Apple's DriverKit has been changed in upstream LLVM ( D121911 [Clang] to add DriverKit support ) to default to GNU++17 instead of GNU++14.

At present, the relevant patches have been released, and there are no emergencies. It should be a sure thing to switch the default standard to GNU++ 17.

After switching the default version, for C++ codebases that are currently incompatible with C++17 and rely on the default, you will need to set -std=gnu++14 or earlier to maintain compatibility with the default.

Guess you like

Origin www.oschina.net/news/209604/llvm-16-switch-to-gnu-17-as-default-dialec