diff options
author | Ed Smith-Rowland <3dw4rd@verizon.net> | 2012-11-10 00:08:49 +0000 |
---|---|---|
committer | Edward Smith-Rowland <emsr@gcc.gnu.org> | 2012-11-10 00:08:49 +0000 |
commit | a4a0016d60bc7cd8953b162f44c793801e09441c (patch) | |
tree | 6f4eb9fb1a2dfd8c43e78bcc98930f16138e78c4 /gcc/c-family | |
parent | 97996ede57cfd5ea8ab2e1b7c2ff04d311894128 (diff) | |
download | gcc-a4a0016d60bc7cd8953b162f44c793801e09441c.zip gcc-a4a0016d60bc7cd8953b162f44c793801e09441c.tar.gz gcc-a4a0016d60bc7cd8953b162f44c793801e09441c.tar.bz2 |
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')
-rw-r--r-- | gcc/c-family/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c-family/c-opts.c | 16 | ||||
-rw-r--r-- | gcc/c-family/c.opt | 5 |
3 files changed, 25 insertions, 2 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index b3234d3..85e113c 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 eb6b2d9..d86a165 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 fe1fc4d..1b5c51a 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 |