[PATCH] PR libstdc++/79789 fix non-reserved names in headers

Jonathan Wakely jwakely@redhat.com
Tue Mar 7 12:26:00 GMT 2017


On 03/03/17 10:47 -0500, David Edelsohn wrote:
>This patch caused a new regression on AIX.
>
>- David
>
>FAIL: 17_intro/names.cc (test for excess errors)
>Excess errors:
>/tmp/GCC/gcc/include-fixed/sys/types.h:600: error: expected
>unqualified-id before '[' token
>/tmp/GCC/gcc/include-fixed/sys/types.h:600: error: expected ')' before '[' token
>/tmp/GCC/gcc/include-fixed/sys/types.h:668: error: expected
>unqualified-id before '[' token
>/tmp/GCC/gcc/include-fixed/sys/types.h:668: error: expected ')' before '[' token
>/tmp/GCC/gcc/include-fixed/stdlib.h:332: error: 'parameter' declared
>as function returning a function
>/tmp/GCC/gcc/include-fixed/stdlib.h:332: error: expected
>primary-expression before 'void'
>/tmp/GCC/gcc/include-fixed/math.h:1458: error: expected unqualified-id
>before ',' token
>/tmp/GCC/gcc/include-fixed/math.h:1458: error: expected ')' before ',' token
>
>AIX types.h:600 is
>
>typedef struct { int r[1]; } *  physadr_t;
>
>stdlib.h:332 is
>
>        extern int      at_quick_exit(void (*f)(void));
>
>math.h:1458 is
>
>     struct dbl_hypot {
>         double x, y;
>     };

I think the AIX headers should be using reserved names there, but this
should fix it:

--- a/libstdc++-v3/testsuite/17_intro/names.cc
+++ b/libstdc++-v3/testsuite/17_intro/names.cc
@@ -55,7 +55,9 @@
 // <queue> and <stack> defined data members called c
 #define d (
 #define e (
+#ifndef _AIX
 #define f (
+#endif
 #define g (
 #if __cplusplus >= 201402L
 // <chrono> defines operator ""h in C++14
@@ -84,7 +86,9 @@
 #define p (
 #endif
 #define q (
+#ifndef _AIX
 #define r (
+#endif
 #if __cplusplus >= 201103L
 // <random> defines member functions called s() and t()
 // <chrono> and <string> define operator ""s in C++14
@@ -95,7 +99,9 @@
 #define u (
 #define v (
 #define w (
+#ifndef _AIX
 #define x (
 #define y (
+#endif
 #define z (
 #include <bits/stdc++.h>

I'll test it later today.




More information about the Gcc-patches mailing list