summaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authoremsr <emsr@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-28 02:38:24 +0000
committeremsr <emsr@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-28 02:38:24 +0000
commit2ab4e475337c409449a1982e504ed83d94ee32ed (patch)
tree52684ca4b76255d7a5b61ebbf050e5ead8070089 /libcpp
parent23132abe656f5b473dd69a459b6cc1500517be5f (diff)
downloadgcc-2ab4e475337c409449a1982e504ed83d94ee32ed.tar.gz
libcpp/
2014-08-27 Edward Smith-Rowland <3dw4rd@verizon.net> PR cpp/23827 - standard C++ should not have hex float preprocessor tokens * libcpp/init.c (lang_flags): Change CXX98 flag for extended numbers from 1 to 0. * libcpp/expr.c (cpp_classify_number): Weite error message for improper use of hex floating literal. gcc/testsuite/ 2014-08-27 Edward Smith-Rowland <3dw4rd@verizon.net> PR cpp/23827 - standard C++ should not have hex float preprocessor tokens * g++.dg/cpp/pr23827_cxx11.C: New. * g++.dg/cpp/pr23827_cxx98.C: New. * g++.dg/cpp/pr23827_cxx98_neg.C: New. * gcc.dg/cpp/pr23827_c90.c: New. * gcc.dg/cpp/pr23827_c90_neg.c: New. * gcc.dg/cpp/pr23827_c99.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214616 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog9
-rw-r--r--libcpp/expr.c13
-rw-r--r--libcpp/init.c2
3 files changed, 20 insertions, 4 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 1b4e31d6be2..7f88f7aa405 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,12 @@
+2014-08-28 Edward Smith-Rowland <3dw4rd@verizon.net>
+
+ PR cpp/23827 - standard C++ should not have hex float preprocessor
+ tokens
+ * libcpp/init.c (lang_flags): Change CXX98 flag for extended numbers
+ from 1 to 0.
+ * libcpp/expr.c (cpp_classify_number): Weite error message for improper
+ use of hex floating literal.
+
2014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
* include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z;
diff --git a/libcpp/expr.c b/libcpp/expr.c
index 07f1b2fb419..519bb878b6f 100644
--- a/libcpp/expr.c
+++ b/libcpp/expr.c
@@ -540,9 +540,16 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token,
SYNTAX_ERROR_AT (virtual_location,
"no digits in hexadecimal floating constant");
- if (radix == 16 && CPP_PEDANTIC (pfile) && !CPP_OPTION (pfile, c99))
- cpp_error_with_line (pfile, CPP_DL_PEDWARN, virtual_location, 0,
- "use of C99 hexadecimal floating constant");
+ if (radix == 16 && CPP_PEDANTIC (pfile)
+ && !CPP_OPTION (pfile, extended_numbers))
+ {
+ if (CPP_OPTION (pfile, cplusplus))
+ cpp_error_with_line (pfile, CPP_DL_PEDWARN, virtual_location, 0,
+ "use of C++11 hexadecimal floating constant");
+ else
+ cpp_error_with_line (pfile, CPP_DL_PEDWARN, virtual_location, 0,
+ "use of C99 hexadecimal floating constant");
+ }
if (float_flag == AFTER_EXPON)
{
diff --git a/libcpp/init.c b/libcpp/init.c
index 0d2f73718be..7aace802682 100644
--- a/libcpp/init.c
+++ b/libcpp/init.c
@@ -103,7 +103,7 @@ static const struct lang_flags lang_defaults[] =
/* STDC99 */ { 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1 },
/* STDC11 */ { 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1 },
/* GNUCXX */ { 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0 },
- /* CXX98 */ { 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1 },
+ /* CXX98 */ { 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1 },
/* GNUCXX11 */ { 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0 },
/* CXX11 */ { 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1 },
/* GNUCXX14 */ { 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0 },