aboutsummaryrefslogtreecommitdiff
path: root/libcpp/init.c
diff options
context:
space:
mode:
authorPaolo Carlini <paolo@gcc.gnu.org>2013-04-24 19:33:54 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2013-04-24 19:33:54 +0000
commit61949153f4972928c912cf1a93f5ef869e5c9484 (patch)
tree91930b32804dd6992b551ef2b873cca0c78f0181 /libcpp/init.c
parent5576178bbdd88f7e5a3ceb27c1de3d6bf4856de0 (diff)
downloadgcc-61949153f4972928c912cf1a93f5ef869e5c9484.zip
gcc-61949153f4972928c912cf1a93f5ef869e5c9484.tar.gz
gcc-61949153f4972928c912cf1a93f5ef869e5c9484.tar.bz2
cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y.
/libcpp 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com> * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y. * init.c (lang_defaults): Add defaults for the latter. (cpp_init_builtins): Define __cplusplus as 201300L for the latter. * lex.c (_cpp_lex_direct): Update. /gcc/c-family 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com> * c-opts.c (set_std_cxx11): Use CLK_CXX1Y and CLK_GNUCXX1Y. /gcc/testsuite 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/cpp1y/cplusplus.C: New. From-SVN: r198261
Diffstat (limited to 'libcpp/init.c')
-rw-r--r--libcpp/init.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/libcpp/init.c b/libcpp/init.c
index 3037ecd..c3fa4af 100644
--- a/libcpp/init.c
+++ b/libcpp/init.c
@@ -98,11 +98,13 @@ static const struct lang_flags lang_defaults[] =
/* CXX98 */ { 0, 1, 1, 0, 1, 1, 1, 0, 0, 0 },
/* GNUCXX11 */ { 1, 1, 1, 0, 0, 1, 1, 1, 1, 1 },
/* CXX11 */ { 1, 1, 1, 0, 1, 1, 1, 1, 1, 1 },
+ /* GNUCXX1Y */ { 1, 1, 1, 0, 0, 1, 1, 1, 1, 1 },
+ /* CXX1Y */ { 1, 1, 1, 0, 1, 1, 1, 1, 1, 1 },
/* ASM */ { 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }
- /* xid should be 1 for GNUC99, STDC99, GNUCXX, CXX98, GNUCXX11, and
- CXX11 when no longer experimental (when all uses of identifiers
- in the compiler have been audited for correct handling of
- extended identifiers). */
+ /* xid should be 1 for GNUC99, STDC99, GNUCXX, CXX98, GNUCXX11, CXX11,
+ GNUCXX1Y, and CXX1Y when no longer experimental (when all uses of
+ identifiers in the compiler have been audited for correct handling
+ of extended identifiers). */
};
/* Sets internal flags correctly for a given language. */
@@ -476,8 +478,11 @@ cpp_init_builtins (cpp_reader *pfile, int hosted)
if (CPP_OPTION (pfile, cplusplus))
{
- if (CPP_OPTION (pfile, lang) == CLK_CXX11
- || CPP_OPTION (pfile, lang) == CLK_GNUCXX11)
+ if (CPP_OPTION (pfile, lang) == CLK_CXX1Y
+ || CPP_OPTION (pfile, lang) == CLK_GNUCXX1Y)
+ _cpp_define_builtin (pfile, "__cplusplus 201300L");
+ else 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");