https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97974
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:936d500dfc17f58f2507ecd0f7f26e4f197052ee commit r11-8120-g936d500dfc17f58f2507ecd0f7f26e4f197052ee Author: Jason Merrill <ja...@redhat.com> Date: Sat Apr 10 14:00:15 2021 -0400 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.