public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [PATCH] PR libstdc++/79789 fix non-reserved names in headers
@ 2017-03-03 15:47 David Edelsohn
  2017-03-07 12:26 ` Jonathan Wakely
  2017-03-09 19:46 ` Jonathan Wakely
  0 siblings, 2 replies; 8+ messages in thread
From: David Edelsohn @ 2017-03-03 15:47 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: libstdc++, GCC Patches

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;
     };

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] PR libstdc++/79789 fix non-reserved names in headers
  2017-03-03 15:47 [PATCH] PR libstdc++/79789 fix non-reserved names in headers David Edelsohn
@ 2017-03-07 12:26 ` Jonathan Wakely
  2017-03-09 19:46 ` Jonathan Wakely
  1 sibling, 0 replies; 8+ messages in thread
From: Jonathan Wakely @ 2017-03-07 12:26 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Jonathan Wakely, libstdc++, GCC Patches

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.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] PR libstdc++/79789 fix non-reserved names in headers
  2017-03-03 15:47 [PATCH] PR libstdc++/79789 fix non-reserved names in headers David Edelsohn
  2017-03-07 12:26 ` Jonathan Wakely
@ 2017-03-09 19:46 ` Jonathan Wakely
  2017-03-10 15:20   ` Jonathan Wakely
  1 sibling, 1 reply; 8+ messages in thread
From: Jonathan Wakely @ 2017-03-09 19:46 UTC (permalink / raw)
  To: David Edelsohn; +Cc: libstdc++, GCC Patches

On 03/03/17 10:47 -0500, David Edelsohn wrote:
>This patch caused a new regression on AIX.

I'm unable to bootstrap on either gcc111 or gcc119 so I can't test
the fix.


>- 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;
>     };

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] PR libstdc++/79789 fix non-reserved names in headers
  2017-03-09 19:46 ` Jonathan Wakely
@ 2017-03-10 15:20   ` Jonathan Wakely
  2017-03-10 16:11     ` David Edelsohn
  2017-03-14 23:14     ` Jonathan Wakely
  0 siblings, 2 replies; 8+ messages in thread
From: Jonathan Wakely @ 2017-03-10 15:20 UTC (permalink / raw)
  To: David Edelsohn; +Cc: libstdc++, GCC Patches

[-- Attachment #1: Type: text/plain, Size: 523 bytes --]

On 09/03/17 19:46 +0000, Jonathan Wakely wrote:
>On 03/03/17 10:47 -0500, David Edelsohn wrote:
>>This patch caused a new regression on AIX.
>
>I'm unable to bootstrap on either gcc111 or gcc119 so I can't test
>the fix.

export CONFIG_SHELL=/usr/bin/bash
PATH=/opt/freeware/bin:$PATH
$gccsrcdir/configure ... --disable-werror --with-included-gettext --with-gmp=/opt/cfarm --with-libiconv-prefix=/opt/cfarm --disable-libstdcxx-pch

Here's what I'm committing to trunk.

Tested powerpc64le-linux and powerpc-ibm-aix7.2.0.0


[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 733 bytes --]

commit 5e390a2874a9629c13eaddb76f82a66f0634a864
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Mar 10 13:14:33 2017 +0000

    Fix libstdc++ reserved names test to pass on AIX
    
    	* testsuite/17_intro/names.cc: Undefine macros that clash with
    	identifiers in AIX system headers.

diff --git a/libstdc++-v3/testsuite/17_intro/names.cc b/libstdc++-v3/testsuite/17_intro/names.cc
index a7d9a6b..c525861 100644
--- a/libstdc++-v3/testsuite/17_intro/names.cc
+++ b/libstdc++-v3/testsuite/17_intro/names.cc
@@ -98,4 +98,13 @@
 #define x (
 #define y (
 #define z (
+
+#ifdef _AIX
+// See https://gcc.gnu.org/ml/libstdc++/2017-03/msg00015.html
+#undef f
+#undef r
+#undef x
+#undef y
+#endif
+
 #include <bits/stdc++.h>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] PR libstdc++/79789 fix non-reserved names in headers
  2017-03-10 15:20   ` Jonathan Wakely
@ 2017-03-10 16:11     ` David Edelsohn
  2017-03-14 23:14     ` Jonathan Wakely
  1 sibling, 0 replies; 8+ messages in thread
From: David Edelsohn @ 2017-03-10 16:11 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: libstdc++, GCC Patches

On Fri, Mar 10, 2017 at 10:20 AM, Jonathan Wakely <jwakely@redhat.com> wrote:
> On 09/03/17 19:46 +0000, Jonathan Wakely wrote:
>>
>> On 03/03/17 10:47 -0500, David Edelsohn wrote:
>>>
>>> This patch caused a new regression on AIX.
>>
>>
>> I'm unable to bootstrap on either gcc111 or gcc119 so I can't test
>> the fix.
>
>
> export CONFIG_SHELL=/usr/bin/bash
> PATH=/opt/freeware/bin:$PATH
> $gccsrcdir/configure ... --disable-werror --with-included-gettext
> --with-gmp=/opt/cfarm --with-libiconv-prefix=/opt/cfarm
> --disable-libstdcxx-pch
>
> Here's what I'm committing to trunk.
>
> Tested powerpc64le-linux and powerpc-ibm-aix7.2.0.0

Great!

Thank you very much!

- David

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] PR libstdc++/79789 fix non-reserved names in headers
  2017-03-10 15:20   ` Jonathan Wakely
  2017-03-10 16:11     ` David Edelsohn
@ 2017-03-14 23:14     ` Jonathan Wakely
  1 sibling, 0 replies; 8+ messages in thread
From: Jonathan Wakely @ 2017-03-14 23:14 UTC (permalink / raw)
  To: David Edelsohn; +Cc: libstdc++, GCC Patches

On 10/03/17 15:20 +0000, Jonathan Wakely wrote:
>On 09/03/17 19:46 +0000, Jonathan Wakely wrote:
>>On 03/03/17 10:47 -0500, David Edelsohn wrote:
>>>This patch caused a new regression on AIX.
>>
>>I'm unable to bootstrap on either gcc111 or gcc119 so I can't test
>>the fix.
>
>export CONFIG_SHELL=/usr/bin/bash
>PATH=/opt/freeware/bin:$PATH
>$gccsrcdir/configure ... --disable-werror --with-included-gettext --with-gmp=/opt/cfarm --with-libiconv-prefix=/opt/cfarm --disable-libstdcxx-pch
>
>Here's what I'm committing to trunk.
>
>Tested powerpc64le-linux and powerpc-ibm-aix7.2.0.0

Also committed to gcc-5-branch and gcc-6-branch.


>commit 5e390a2874a9629c13eaddb76f82a66f0634a864
>Author: Jonathan Wakely <jwakely@redhat.com>
>Date:   Fri Mar 10 13:14:33 2017 +0000
>
>    Fix libstdc++ reserved names test to pass on AIX
>    
>    	* testsuite/17_intro/names.cc: Undefine macros that clash with
>    	identifiers in AIX system headers.
>
>diff --git a/libstdc++-v3/testsuite/17_intro/names.cc b/libstdc++-v3/testsuite/17_intro/names.cc
>index a7d9a6b..c525861 100644
>--- a/libstdc++-v3/testsuite/17_intro/names.cc
>+++ b/libstdc++-v3/testsuite/17_intro/names.cc
>@@ -98,4 +98,13 @@
> #define x (
> #define y (
> #define z (
>+
>+#ifdef _AIX
>+// See https://gcc.gnu.org/ml/libstdc++/2017-03/msg00015.html
>+#undef f
>+#undef r
>+#undef x
>+#undef y
>+#endif
>+
> #include <bits/stdc++.h>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] PR libstdc++/79789 fix non-reserved names in headers
  2017-03-02  5:25 Jonathan Wakely
@ 2017-03-02 18:59 ` Jonathan Wakely
  0 siblings, 0 replies; 8+ messages in thread
From: Jonathan Wakely @ 2017-03-02 18:59 UTC (permalink / raw)
  To: libstdc++, gcc-patches

On 2 March 2017 at 05:25, Jonathan Wakely wrote:
> Some of these are years old, most are more recent. The new testcase
> should help prevent us trying to use these names again.
>
>         PR libstdc++/79789
>         * include/bits/hashtable_policy.h (__clp2): Use reserved names for
>         parameters and local variables.
>         * include/bits/ios_base.h (make_error_code, make_error_condition):
>         Likewise.
>         * include/bits/list.tcc (list::sort): Likewise.
>         * include/bits/mask_array.h (mask_array): Likewise.
>         * include/bits/regex.h (regex_token_iterator): Likewise.
>         * include/bits/slice_array.h (slice_array): Likewise.
>         * include/bits/stl_algo.h (__sample): Likewise.
>         * include/std/memory (undeclare_no_pointers): Likewise.
>         * include/std/type_traits (is_callable_v, is_nothrow_callable_v):
>         Likewise.
>         * libsupc++/exception_ptr.h (__dest_thunk): Likewise.
>         * testsuite/17_intro/headers/names.cc: New test.

I meant to put this new test in 17_intro not 17_intro/headers, so I've moved it.

        * testsuite/17_intro/headers/names.cc: Rename to ...
        * testsuite/17_intro/names.cc: ... here.

> Tested powerpc64le-linux, committed to trunk.
>
> I'll backport pieces of this as appropriate to the branches.

Done.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] PR libstdc++/79789 fix non-reserved names in headers
@ 2017-03-02  5:25 Jonathan Wakely
  2017-03-02 18:59 ` Jonathan Wakely
  0 siblings, 1 reply; 8+ messages in thread
From: Jonathan Wakely @ 2017-03-02  5:25 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1043 bytes --]

Some of these are years old, most are more recent. The new testcase
should help prevent us trying to use these names again.

        PR libstdc++/79789
        * include/bits/hashtable_policy.h (__clp2): Use reserved names for
        parameters and local variables.
        * include/bits/ios_base.h (make_error_code, make_error_condition):
        Likewise.
        * include/bits/list.tcc (list::sort): Likewise.
        * include/bits/mask_array.h (mask_array): Likewise.
        * include/bits/regex.h (regex_token_iterator): Likewise.
        * include/bits/slice_array.h (slice_array): Likewise.
        * include/bits/stl_algo.h (__sample): Likewise.
        * include/std/memory (undeclare_no_pointers): Likewise.
        * include/std/type_traits (is_callable_v, is_nothrow_callable_v):
        Likewise.
        * libsupc++/exception_ptr.h (__dest_thunk): Likewise.
        * testsuite/17_intro/headers/names.cc: New test.

Tested powerpc64le-linux, committed to trunk.

I'll backport pieces of this as appropriate to the branches.

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 11160 bytes --]

commit 4831cf64a6d7a5ee155b88428768067f481f994b
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Mar 2 02:55:41 2017 +0000

    PR libstdc++/79789 fix non-reserved names in headers
    
    	PR libstdc++/79789
    	* include/bits/hashtable_policy.h (__clp2): Use reserved names for
    	parameters and local variables.
    	* include/bits/ios_base.h (make_error_code, make_error_condition):
    	Likewise.
    	* include/bits/list.tcc (list::sort): Likewise.
    	* include/bits/mask_array.h (mask_array): Likewise.
    	* include/bits/regex.h (regex_token_iterator): Likewise.
    	* include/bits/slice_array.h (slice_array): Likewise.
    	* include/bits/stl_algo.h (__sample): Likewise.
    	* include/std/memory (undeclare_no_pointers): Likewise.
    	* include/std/type_traits (is_callable_v, is_nothrow_callable_v):
    	Likewise.
    	* libsupc++/exception_ptr.h (__dest_thunk): Likewise.
    	* testsuite/17_intro/headers/names.cc: New test.

diff --git a/libstdc++-v3/include/bits/hashtable_policy.h b/libstdc++-v3/include/bits/hashtable_policy.h
index cfa27a3..8af8c49 100644
--- a/libstdc++-v3/include/bits/hashtable_policy.h
+++ b/libstdc++-v3/include/bits/hashtable_policy.h
@@ -521,24 +521,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// Compute closest power of 2.
   _GLIBCXX14_CONSTEXPR
   inline std::size_t
-  __clp2(std::size_t n) noexcept
+  __clp2(std::size_t __n) noexcept
   {
 #if __SIZEOF_SIZE_T__ >= 8
-    std::uint_fast64_t x = n;
+    std::uint_fast64_t __x = __n;
 #else
-    std::uint_fast32_t x = n;
+    std::uint_fast32_t __x = __n;
 #endif
     // Algorithm from Hacker's Delight, Figure 3-3.
-    x = x - 1;
-    x = x | (x >> 1);
-    x = x | (x >> 2);
-    x = x | (x >> 4);
-    x = x | (x >> 8);
-    x = x | (x >>16);
+    __x = __x - 1;
+    __x = __x | (__x >> 1);
+    __x = __x | (__x >> 2);
+    __x = __x | (__x >> 4);
+    __x = __x | (__x >> 8);
+    __x = __x | (__x >>16);
 #if __SIZEOF_SIZE_T__ >= 8
-    x = x | (x >>32);
+    __x = __x | (__x >>32);
 #endif
-    return x + 1;
+    return __x + 1;
   }
 
   /// Rehash policy providing power of 2 bucket numbers. Avoids modulo
diff --git a/libstdc++-v3/include/bits/ios_base.h b/libstdc++-v3/include/bits/ios_base.h
index 965ec8a..f1ebfcc 100644
--- a/libstdc++-v3/include/bits/ios_base.h
+++ b/libstdc++-v3/include/bits/ios_base.h
@@ -207,12 +207,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   const error_category& iostream_category() noexcept;
 
   inline error_code
-  make_error_code(io_errc e) noexcept
-  { return error_code(static_cast<int>(e), iostream_category()); }
+  make_error_code(io_errc __e) noexcept
+  { return error_code(static_cast<int>(__e), iostream_category()); }
 
   inline error_condition
-  make_error_condition(io_errc e) noexcept
-  { return error_condition(static_cast<int>(e), iostream_category()); }
+  make_error_condition(io_errc __e) noexcept
+  { return error_condition(static_cast<int>(__e), iostream_category()); }
 #endif
 
   // 27.4.2  Class ios_base
diff --git a/libstdc++-v3/include/bits/list.tcc b/libstdc++-v3/include/bits/list.tcc
index d80d569..9623a13 100644
--- a/libstdc++-v3/include/bits/list.tcc
+++ b/libstdc++-v3/include/bits/list.tcc
@@ -500,8 +500,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
 	__catch(...)
 	  {
 	    this->splice(this->end(), __carry);
-	    for (int i = 0; i < sizeof(__tmp)/sizeof(__tmp[0]); ++i)
-	      this->splice(this->end(), __tmp[i]);
+	    for (int __i = 0; __i < sizeof(__tmp)/sizeof(__tmp[0]); ++__i)
+	      this->splice(this->end(), __tmp[__i]);
 	    __throw_exception_again;
 	  }
       }
@@ -586,8 +586,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
 	    __catch(...)
 	      {
 		this->splice(this->end(), __carry);
-		for (int i = 0; i < sizeof(__tmp)/sizeof(__tmp[0]); ++i)
-		  this->splice(this->end(), __tmp[i]);
+		for (int __i = 0; __i < sizeof(__tmp)/sizeof(__tmp[0]); ++__i)
+		  this->splice(this->end(), __tmp[__i]);
 		__throw_exception_again;
 	      }
 	  }
diff --git a/libstdc++-v3/include/bits/mask_array.h b/libstdc++-v3/include/bits/mask_array.h
index 9a03ba0..5c4fcc6 100644
--- a/libstdc++-v3/include/bits/mask_array.h
+++ b/libstdc++-v3/include/bits/mask_array.h
@@ -136,8 +136,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     };
 
   template<typename _Tp>
-    inline mask_array<_Tp>::mask_array(const mask_array<_Tp>& a)
-    : _M_sz(a._M_sz), _M_mask(a._M_mask), _M_array(a._M_array) {}
+    inline mask_array<_Tp>::mask_array(const mask_array<_Tp>& __a)
+    : _M_sz(__a._M_sz), _M_mask(__a._M_mask), _M_array(__a._M_array) {}
 
   template<typename _Tp>
     inline
diff --git a/libstdc++-v3/include/bits/regex.h b/libstdc++-v3/include/bits/regex.h
index 17a1ef4..60837ea 100644
--- a/libstdc++-v3/include/bits/regex.h
+++ b/libstdc++-v3/include/bits/regex.h
@@ -2674,9 +2674,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
 			   initializer_list<int>,
 			   regex_constants::match_flag_type =
 			   regex_constants::match_default) = delete;
-      template <std::size_t N>
+      template <std::size_t _Nm>
 	regex_token_iterator(_Bi_iter, _Bi_iter, const regex_type&&,
-			     const int (&)[N],
+			     const int (&)[_Nm],
 			     regex_constants::match_flag_type =
 			     regex_constants::match_default) = delete;
 
diff --git a/libstdc++-v3/include/bits/slice_array.h b/libstdc++-v3/include/bits/slice_array.h
index 870954e..cd668fb 100644
--- a/libstdc++-v3/include/bits/slice_array.h
+++ b/libstdc++-v3/include/bits/slice_array.h
@@ -204,8 +204,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   template<typename _Tp>
     inline
-    slice_array<_Tp>::slice_array(const slice_array<_Tp>& a)
-    : _M_sz(a._M_sz), _M_stride(a._M_stride), _M_array(a._M_array) {}
+    slice_array<_Tp>::slice_array(const slice_array<_Tp>& __a)
+    : _M_sz(__a._M_sz), _M_stride(__a._M_stride), _M_array(__a._M_array) {}
 
   //    template<typename _Tp>
   //    inline slice_array<_Tp>::~slice_array () {}
diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h
index 938e612..2cd5303 100644
--- a/libstdc++-v3/include/bits/stl_algo.h
+++ b/libstdc++-v3/include/bits/stl_algo.h
@@ -5748,11 +5748,11 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
         {
 	  while (__n != 0 && __unsampled_sz >= 2)
 	    {
-	      const pair<_Size, _Size> p =
+	      const pair<_Size, _Size> __p =
 		__gen_two_uniform_ints(__unsampled_sz, __unsampled_sz - 1, __g);
 
 	      --__unsampled_sz;
-	      if (p.first < __n)
+	      if (__p.first < __n)
 		{
 		  *__out++ = *__first;
 		  --__n;
@@ -5763,7 +5763,7 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
 	      if (__n == 0) break;
 
 	      --__unsampled_sz;
-	      if (p.second < __n)
+	      if (__p.second < __n)
 		{
 		  *__out++ = *__first;
 		  --__n;
diff --git a/libstdc++-v3/include/std/memory b/libstdc++-v3/include/std/memory
index 0222cec..2d2d6fa 100644
--- a/libstdc++-v3/include/std/memory
+++ b/libstdc++-v3/include/std/memory
@@ -132,9 +132,9 @@ enum class pointer_safety { relaxed, preferred, strict };
 inline void
 declare_reachable(void*) { }
 
-template <class T>
-  inline T*
-  undeclare_reachable(T* __p) { return __p; }
+template <typename _Tp>
+  inline _Tp*
+  undeclare_reachable(_Tp* __p) { return __p; }
 
 inline void
 declare_no_pointers(char*, size_t) { }
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
index 3e2014e..76865f4 100644
--- a/libstdc++-v3/include/std/type_traits
+++ b/libstdc++-v3/include/std/type_traits
@@ -2892,12 +2892,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     { };
 
   /// std::is_callable_v
-  template<typename T, typename _Ret = void>
-    constexpr bool is_callable_v = is_callable<T, _Ret>::value;
+  template<typename _Tp, typename _Ret = void>
+    constexpr bool is_callable_v = is_callable<_Tp, _Ret>::value;
 
   /// std::is_nothrow_callable_v
-  template<typename T, typename _Ret = void>
-    constexpr bool is_nothrow_callable_v = is_nothrow_callable<T, _Ret>::value;
+  template<typename _Tp, typename _Ret = void>
+    constexpr bool is_nothrow_callable_v
+      = is_nothrow_callable<_Tp, _Ret>::value;
 #endif // C++17
 
 
diff --git a/libstdc++-v3/libsupc++/exception_ptr.h b/libstdc++-v3/libsupc++/exception_ptr.h
index 2447a5a..0ece81d 100644
--- a/libstdc++-v3/libsupc++/exception_ptr.h
+++ b/libstdc++-v3/libsupc++/exception_ptr.h
@@ -168,8 +168,8 @@ namespace std
 
     template<typename _Ex>
       inline void
-      __dest_thunk(void* x)
-      { static_cast<_Ex*>(x)->~_Ex(); }
+      __dest_thunk(void* __x)
+      { static_cast<_Ex*>(__x)->~_Ex(); }
 
   } // namespace __exception_ptr
 
diff --git a/libstdc++-v3/testsuite/17_intro/headers/names.cc b/libstdc++-v3/testsuite/17_intro/headers/names.cc
new file mode 100644
index 0000000..a7d9a6b
--- /dev/null
+++ b/libstdc++-v3/testsuite/17_intro/headers/names.cc
@@ -0,0 +1,101 @@
+// Copyright (C) 2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile }
+
+// Define macros for some common variables names that we must not use for
+// naming variables, parameters etc. in the library.
+#define tmp (
+#define A (
+#define B (
+#define C (
+#define D (
+#define E (
+#define F (
+#define G (
+#define H (
+#define I (
+#define J (
+#define K (
+#define L (
+#define M (
+#define N (
+#define O (
+#define P (
+#define Q (
+#define R (
+#define S (
+#define T (
+#define U (
+#define V (
+#define W (
+#define X (
+#define Y (
+#define Z (
+#if __cplusplus >= 201103L
+// <random> defines member functions called a() and b()
+#else
+#define a (
+#define b (
+#endif
+// <queue> and <stack> defined data members called c
+#define d (
+#define e (
+#define f (
+#define g (
+#if __cplusplus >= 201402L
+// <chrono> defines operator ""h in C++14
+// <complex> defines operator ""i in C++14
+#else
+#define h (
+#define i (
+#endif
+#define j (
+#if __cplusplus >= 201103L
+// <random> defines member functions called k()
+#else
+#define k (
+#endif
+#define l (
+#if __cplusplus >= 201103L
+// <random> defines member functions called m() and n()
+#else
+#define m (
+#define n (
+#endif
+#define o (
+#if __cplusplus >= 201103L
+// <random> defines member functions called p()
+#else
+#define p (
+#endif
+#define q (
+#define r (
+#if __cplusplus >= 201103L
+// <random> defines member functions called s() and t()
+// <chrono> and <string> define operator ""s in C++14
+#else
+#define s (
+#define t (
+#endif
+#define u (
+#define v (
+#define w (
+#define x (
+#define y (
+#define z (
+#include <bits/stdc++.h>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-03-14 23:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-03 15:47 [PATCH] PR libstdc++/79789 fix non-reserved names in headers David Edelsohn
2017-03-07 12:26 ` Jonathan Wakely
2017-03-09 19:46 ` Jonathan Wakely
2017-03-10 15:20   ` Jonathan Wakely
2017-03-10 16:11     ` David Edelsohn
2017-03-14 23:14     ` Jonathan Wakely
  -- strict thread matches above, loose matches on Subject: below --
2017-03-02  5:25 Jonathan Wakely
2017-03-02 18:59 ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).