[Bug libstdc++/79789] [6/7 Regression] non-reserved names in headers

2017-03-01 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79789

--- Comment #3 from Jonathan Wakely  ---
Author: redi
Date: Thu Mar  2 03:43:49 2017
New Revision: 245828

URL: https://gcc.gnu.org/viewcvs?rev=245828=gcc=rev
Log:
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.

Added:
trunk/libstdc++-v3/testsuite/17_intro/headers/names.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/bits/hashtable_policy.h
trunk/libstdc++-v3/include/bits/ios_base.h
trunk/libstdc++-v3/include/bits/list.tcc
trunk/libstdc++-v3/include/bits/mask_array.h
trunk/libstdc++-v3/include/bits/regex.h
trunk/libstdc++-v3/include/bits/slice_array.h
trunk/libstdc++-v3/include/bits/stl_algo.h
trunk/libstdc++-v3/include/std/memory
trunk/libstdc++-v3/include/std/type_traits
trunk/libstdc++-v3/libsupc++/exception_ptr.h

[Bug libstdc++/79789] [6/7 Regression] non-reserved names in headers

2017-03-01 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79789

--- Comment #2 from Jonathan Wakely  ---
And this fails since 5.1.0 with C++11 or later:

#define e 1
#include 

And this fails for all versions at least as far back as 4.3 (although it's only
valid in C++98 and C++03 because C++11 adds member functions called a() in
):

#define a 1
#include 

There are a few other problems too.

[Bug libstdc++/79789] [6/7 Regression] non-reserved names in headers

2017-03-01 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79789

Jonathan Wakely  changed:

   What|Removed |Added

  Known to work|6.3.0   |5.4.0
Summary|[7 Regression] non-reserved |[6/7 Regression]
   |names in   |non-reserved names in
   ||headers
  Known to fail||6.3.0, 7.0

--- Comment #1 from Jonathan Wakely  ---
And this fails in C++11 or later, with GCC 6.1.0 or later:

#define T 1
#include