summaryrefslogtreecommitdiff
path: root/gcc/c-family/c-opts.c
diff options
context:
space:
mode:
authorEd Smith-Rowland <3dw4rd@verizon.net>2012-11-10 00:08:49 +0000
committerEdward Smith-Rowland <emsr@gcc.gnu.org>2012-11-10 00:08:49 +0000
commita4a0016d60bc7cd8953b162f44c793801e09441c (patch)
tree6f4eb9fb1a2dfd8c43e78bcc98930f16138e78c4 /gcc/c-family/c-opts.c
parent97996ede57cfd5ea8ab2e1b7c2ff04d311894128 (diff)
downloadgcc-a4a0016d60bc7cd8953b162f44c793801e09441c.tar.gz
Implement a flag -fext-numeric-literals that allows control of whether GNU...
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. From-SVN: r193382
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: