summaryrefslogtreecommitdiffstats
path: root/gcc/c-family/c-opts.c
diff options
context:
space:
mode:
authoremsr <emsr@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-10 00:08:49 +0000
committeremsr <emsr@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-10 00:08:49 +0000
commit2dd006369c22f7affef6c7082e3671cba988468d (patch)
tree6f4eb9fb1a2dfd8c43e78bcc98930f16138e78c4 /gcc/c-family/c-opts.c
parentec745a53793f0eec84eabfc3b93cb12ba1e4916f (diff)
downloadppe42-gcc-2dd006369c22f7affef6c7082e3671cba988468d.tar.gz
ppe42-gcc-2dd006369c22f7affef6c7082e3671cba988468d.zip
Implement a flag -fext-numeric-literals that allows control of whether GNU
numeric suffix extensions are parsed or passed to C++ as user-defined literals. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193382 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family/c-opts.c')
-rw-r--r--gcc/c-family/c-opts.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index eb6b2d9329d..d86a1651b93 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -578,6 +578,10 @@ c_common_handle_option (size_t scode, const char *arg, int value,
set_struct_debug_option (&global_options, loc, arg);
break;
+ case OPT_fext_numeric_literals:
+ cpp_opts->ext_numeric_literals = value;
+ break;
+
case OPT_idirafter:
add_path (xstrdup (arg), AFTER, 0, true);
break;
@@ -660,13 +664,21 @@ c_common_handle_option (size_t scode, const char *arg, int value,
case OPT_std_c__11:
case OPT_std_gnu__11:
if (!preprocessing_asm_p)
- set_std_cxx11 (code == OPT_std_c__11 /* ISO */);
+ {
+ set_std_cxx11 (code == OPT_std_c__11 /* ISO */);
+ if (code == OPT_std_c__11)
+ cpp_opts->ext_numeric_literals = 0;
+ }
break;
case OPT_std_c__1y:
case OPT_std_gnu__1y:
if (!preprocessing_asm_p)
- set_std_cxx1y (code == OPT_std_c__11 /* ISO */);
+ {
+ set_std_cxx1y (code == OPT_std_c__1y /* ISO */);
+ if (code == OPT_std_c__1y)
+ cpp_opts->ext_numeric_literals = 0;
+ }
break;
case OPT_std_c90:
OpenPOWER on IntegriCloud