diff options
author | Jason Merrill <jason@redhat.com> | 2014-06-26 14:15:29 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2014-06-26 14:15:29 -0400 |
commit | da73100b48932e7e01669993031fd694ed1590b2 (patch) | |
tree | d199320e18256021973a188688722031198ee26f /gcc/c-family/c-opts.c | |
parent | f8a36c783d8cc386ad77c2a5ed005273071db157 (diff) | |
download | gcc-da73100b48932e7e01669993031fd694ed1590b2.zip gcc-da73100b48932e7e01669993031fd694ed1590b2.tar.gz gcc-da73100b48932e7e01669993031fd694ed1590b2.tar.bz2 |
c-common.h (enum cxx_dialect): Add cxx1z.
* c-common.h (enum cxx_dialect): Add cxx1z.
* c.opt (std=c++1z, std=c++17, std=gnu++1z, std=gnu++17): New.
* c-opts.c (c_common_handle_option, set_std_cxx1z): Handle it.
From-SVN: r212042
Diffstat (limited to 'gcc/c-family/c-opts.c')
-rw-r--r-- | gcc/c-family/c-opts.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c index 97215fc..968b703 100644 --- a/gcc/c-family/c-opts.c +++ b/gcc/c-family/c-opts.c @@ -116,6 +116,7 @@ static void handle_OPT_d (const char *); static void set_std_cxx98 (int); static void set_std_cxx11 (int); static void set_std_cxx1y (int); +static void set_std_cxx1z (int); static void set_std_c89 (int, int); static void set_std_c99 (int); static void set_std_c11 (int); @@ -702,6 +703,16 @@ c_common_handle_option (size_t scode, const char *arg, int value, } break; + case OPT_std_c__1z: + case OPT_std_gnu__1z: + if (!preprocessing_asm_p) + { + set_std_cxx1z (code == OPT_std_c__1z /* ISO */); + if (code == OPT_std_c__1z) + cpp_opts->ext_numeric_literals = 0; + } + break; + case OPT_std_c90: case OPT_std_iso9899_199409: if (!preprocessing_asm_p) @@ -1579,6 +1590,20 @@ set_std_cxx1y (int iso) cxx_dialect = cxx1y; } +/* Set the C++ 201z draft standard (without GNU extensions if ISO). */ +static void +set_std_cxx1z (int iso) +{ + cpp_set_lang (parse_in, iso ? CLK_CXX1Y: CLK_GNUCXX1Y); + flag_no_gnu_keywords = iso; + flag_no_nonansi_builtin = iso; + flag_iso = iso; + /* C++11 includes the C99 standard library. */ + flag_isoc94 = 1; + flag_isoc99 = 1; + cxx_dialect = cxx1z; +} + /* Args to -d specify what to dump. Silently ignore unrecognized options; they may be aimed at toplev.c. */ static void |