diff options
author | Jason Merrill <jason@redhat.com> | 2011-10-31 15:34:26 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-10-31 15:34:26 -0400 |
commit | 1fb80b0c5359f696aa61d537e25b7901d8b56ff7 (patch) | |
tree | 1b67899479635e50951367854c15bfb0ef27354d /libcpp/init.c | |
parent | 97e3ad20b12a5a317d98085df6f18a87f681f377 (diff) | |
download | gcc-1fb80b0c5359f696aa61d537e25b7901d8b56ff7.zip gcc-1fb80b0c5359f696aa61d537e25b7901d8b56ff7.tar.gz gcc-1fb80b0c5359f696aa61d537e25b7901d8b56ff7.tar.bz2 |
re PR libstdc++/1773 (__cplusplus defined to 1, should be 199711L)
PR libstdc++/1773
* init.c (cpp_init_builtins): Set __cplusplus for C++11.
From-SVN: r180708
Diffstat (limited to 'libcpp/init.c')
-rw-r--r-- | libcpp/init.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libcpp/init.c b/libcpp/init.c index bbaa8ae..9101b34 100644 --- a/libcpp/init.c +++ b/libcpp/init.c @@ -461,7 +461,13 @@ cpp_init_builtins (cpp_reader *pfile, int hosted) _cpp_define_builtin (pfile, "__STDC__ 1"); if (CPP_OPTION (pfile, cplusplus)) - _cpp_define_builtin (pfile, "__cplusplus 199711L"); + { + if (CPP_OPTION (pfile, lang) == CLK_CXX11 + || CPP_OPTION (pfile, lang) == CLK_GNUCXX11) + _cpp_define_builtin (pfile, "__cplusplus 201103L"); + else + _cpp_define_builtin (pfile, "__cplusplus 199711L"); + } else if (CPP_OPTION (pfile, lang) == CLK_ASM) _cpp_define_builtin (pfile, "__ASSEMBLER__ 1"); else if (CPP_OPTION (pfile, lang) == CLK_STDC94) |