diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-10-31 19:34:26 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-10-31 19:34:26 +0000 |
commit | de803ff2bd68855c6b866113e6d36bbd315cb9cf (patch) | |
tree | 1b67899479635e50951367854c15bfb0ef27354d /libcpp/init.c | |
parent | 0d84dc2d5601a2cf0a01c5172d2942c6d3af339d (diff) | |
download | gcc-de803ff2bd68855c6b866113e6d36bbd315cb9cf.tar.gz |
PR libstdc++/1773
* init.c (cpp_init_builtins): Set __cplusplus for C++11.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180708 138bc75d-0d04-0410-961f-82ee72b054a4
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 bbaa8ae10c3..9101b34e086 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) |