c++: Stat-hack for members [PR 98530]
authorNathan Sidwell <nathan@acm.org>
Thu, 21 Jan 2021 12:48:39 +0000 (04:48 -0800)
committerNathan Sidwell <nathan@acm.org>
Thu, 21 Jan 2021 12:54:43 +0000 (04:54 -0800)
commit3c1cf7350bff6ba03faaa61b44d74bf8a06c6543
treef8236d78d111f94f165eafce0e8981ac633f3f1d
parenta1a967ce1ffe17cc6e6afaf76655314ab07a8de1
c++: Stat-hack for members [PR 98530]

This was a header file that deployed the stat-hack inside a class
(both a member-class and a [non-static data] member had the same
name).  Due to the way that's represented in name lookup we missed the
class.  Sadly just changing the representation globally has
detrimental effects elsewhere, and this is a rare case, so just
creating a new overload on the fly shouldn't be a problem.

PR c++/98530
gcc/cp/
* name-lookup.c (lookup_class_binding): Rearrange a stat-hack.
gcc/testsuite/
* g++.dg/modules/stat-mem-1.h: New.
* g++.dg/modules/stat-mem-1_a.H: New.
* g++.dg/modules/stat-mem-1_b.C: New.
gcc/cp/name-lookup.c
gcc/testsuite/g++.dg/modules/stat-mem-1.h [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/stat-mem-1_a.H [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/stat-mem-1_b.C [new file with mode: 0644]