Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set as default C++11 in Clang

The LLVM C++ compiler has full support for C++11 standard. Is there a way to set C++11 as the default standard without adding -std=c++11 compiler flag every time? I tried setting CCXFLAGS environment variable to -std=c++11, but with no luck.

like image 660
Szőke Szabolcs Avatar asked Feb 05 '14 15:02

Szőke Szabolcs


People also ask

How do you use C ++ 11 in Clang?

C++11 implementation status You can use Clang in C++11 mode with the -std=c++11 option. Clang's C++11 mode can be used with libc++ or with gcc's libstdc++.

What version of C does Clang use?

Clang is C++14 feature complete.

Does Clang support C 17?

Clang has support for some of the features of the C standard following C17, informally referred to as C2x.

Does Clang work for C?

The Clang tool is a front end compiler that is used to compile programming languages such as C++, C, Objective C++ and Objective C into machine code.


1 Answers

Use clang 6.0.0 or higher. The default C++ dialect is now C++14.

http://releases.llvm.org/6.0.1/tools/clang/docs/ReleaseNotes.html#c-language-changes-in-clang

like image 81
Bulletmagnet Avatar answered Oct 27 '22 18:10

Bulletmagnet