This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR libstdc++/79789 fix non-reserved names in headers
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: David Edelsohn <dje dot gcc at gmail dot com>
- Cc: Jonathan Wakely <jwakely dot gcc at gmail dot com>, "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 7 Mar 2017 12:26:09 +0000
- Subject: Re: [PATCH] PR libstdc++/79789 fix non-reserved names in headers
- Authentication-results: sourceware.org; auth=none
- References: <CAGWvnymjGP5ZpP3e4O-=3K17D=OK1Uda5ixOL_mwmv=hEgxBkw@mail.gmail.com>
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.