https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97974
--- Comment #4 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:58a92b789a77cdade1f41800efebf6e0686f9982 commit r12-298-g58a92b789a77cdade1f41800efebf6e0686f9982 Author: Jason Merrill <ja...@redhat.com> Date: Sat Apr 10 14:00:15 2021 -0400 c++: ICE with anonymous union [PR97974] While working on the GCC 11 patch, it occurred to me that we could move the errors about invalid members from finish_struct_anon_r to here, so we properly get a diagnostic in g++.law/union4.C. gcc/cp/ChangeLog: PR c++/97974 * class.c (finish_struct_anon_r): Drop complain parm. Remove non-field diagnostic. (finish_struct_anon): Adjust. * decl.c (fixup_anonymous_aggr): Move non-field diagnostic here. gcc/testsuite/ChangeLog: PR c++/97974 * g++.old-deja/g++.law/union4.C: Add expected diagnostic.