Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What macro does Clang define to announce C++11 mode, if any?

Tags:

c++

c++11

clang

What macro does Clang define to announce C++11 mode, if any?

GCC defines __GXX_EXPERIMENTAL_CXX0X__, at least some versions do. MSVC seems to have the support turned on by default at least for _MSC_VER >= 1600.

like image 667
wilx Avatar asked Aug 21 '11 15:08

wilx


People also ask

Can I compile C++98 code in C++11 mode?

You should be able to just compile C++98 code in C++11 mode without problem. <stdint.h> is a C99 header. I don't know what vendor's C standard library you;re using, but if it's the native Microsoft Windows one it doesn't support C99 yet.

How to define a macro in C language?

In C, the macro is used to define any constant value or any variable with its value in the entire program that will be replaced by this macro name, where macro contains the set of code that will be called when the macro name is used in the program. The macro uses the “#define” directive to define the macro in C programming language.

What is the __no_inline__ macro symbol in tiarmclang?

If no optimization level is specified on the tiarmclang command-line, then tiarmclang defines the __NO_INLINE__ macro symbol to indicate that compilation mode.

Is Clang conformant or non-conformant?

Clang uses a non-conformant method of indicating support for various features instead of the standards-sanctioned ways, which means you're going to need to use libc++ for the standard library because other vendor's standard C++ libraries are conformant.


1 Answers

It uses different preprocessor tests for each separate feature, like

#if  __has_feature(cxx_decltype)

for testing if decltype is implemented.

See the complete list here

http://clang.llvm.org/docs/LanguageExtensions.html#checking_upcoming_features

like image 109
Bo Persson Avatar answered Sep 28 '22 20:09

Bo Persson