===================================================================
@@ -102,7 +102,7 @@
/* STDC99 */ { 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0 },
/* STDC11 */ { 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0 },
/* GNUCXX */ { 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0 },
- /* CXX98 */ { 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0 },
+ /* CXX98 */ { 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0 },
/* GNUCXX11 */ { 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0 },
/* CXX11 */ { 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0 },
/* GNUCXX1Y */ { 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1 },
===================================================================
@@ -540,9 +540,16 @@
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)
{
===================================================================
@@ -0,0 +1,22 @@
+// { dg-do run }
+// { dg-options "-std=c++98 -pedantic-errors" }
+
+#define f (
+#define l )
+#define str(x) #x
+#define xstr(x) str(x)
+
+/* C90 and C++: "0x1p+( 0x1p+)"; C99: "0x1p+f 0x1p+l" */
+const char *s = xstr(0x1p+f 0x1p+l);
+
+extern "C" void abort();
+extern "C" int strcmp(const char *, const char *);
+
+int
+main()
+{
+ if (strcmp (s, "0x1p+( 0x1p+)"))
+ abort();
+ else
+ return 0;
+}