c++: ICE with anonymous union [PR97974]
authorJason Merrill <jason@redhat.com>
Sat, 10 Apr 2021 18:00:15 +0000 (14:00 -0400)
committerJason Merrill <jason@redhat.com>
Sun, 11 Apr 2021 03:52:07 +0000 (23:52 -0400)
commit936d500dfc17f58f2507ecd0f7f26e4f197052ee
treee83b9cf454999e17c5303379f0abd5d7c5e31368
parent1d54b13841774aa40f5d0a5ab87b19e7e1276d42
c++: ICE with anonymous union [PR97974]

Here lookup got confused by finding a conversion operator from
lookup_anon_field.  Let's avoid this by pruning functions from
CLASSTYPE_MEMBER_VEC as well as TYPE_FIELDS.

gcc/cp/ChangeLog:

PR c++/97974
* decl.c (fixup_anonymous_aggr): Prune all functions from
CLASSTYPE_MEMBER_VEC.

gcc/testsuite/ChangeLog:

PR c++/97974
* g++.dg/lookup/pr84962.C: Adjust diagnostic.
* g++.dg/other/anon-union5.C: New test.
gcc/cp/decl.c
gcc/testsuite/g++.dg/lookup/pr84962.C
gcc/testsuite/g++.dg/other/anon-union5.C [new file with mode: 0644]