aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family
diff options
context:
space:
mode:
authorEd Smith-Rowland <3dw4rd@verizon.net>2012-11-10 00:08:49 +0000
committerEd Smith-Rowland <3dw4rd@verizon.net>2012-11-10 00:08:49 +0000
commit7f0dea6c581f8d6f1cccb9fe7e4ac2892a8a6d5b (patch)
tree6f4eb9fb1a2dfd8c43e78bcc98930f16138e78c4 /gcc/c-family
parent16d365e3e22faa15b4123044f3981b03cea73ae5 (diff)
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: https://gcc.gnu.org/svn/gcc/trunk@193382 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/ChangeLog6
-rw-r--r--gcc/c-family/c-opts.c16
-rw-r--r--gcc/c-family/c.opt5
3 files changed, 25 insertions, 2 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index b3234d34dd5..85e113ca78e 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,9 @@
+2012-11-09 Ed Smith-Rowland <3dw4rd@verizon.net>
+
+ PR c++/54413
+ * c-opts.c (c_common_handle_option): Set new flags.
+ * c.opt: Describe new flags.
+
2012-11-09 Jason Merrill <jason@redhat.com>
* c.opt (Wabi-tag): New.
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:
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index fe1fc4d5ac0..1b5c51a44c0 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -1234,6 +1234,11 @@ femit-struct-debug-detailed=
C ObjC C++ ObjC++ Joined
-femit-struct-debug-detailed=<spec-list> Detailed reduced debug info for structs
+fext-numeric-literals
+C++ ObjC++
+Interpret imaginary, fixed-point, or other gnu number suffix as the corresponding
+number literal rather than a user-defined number literal.
+
idirafter
C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs)
-idirafter <dir> Add <dir> to the end of the system include path