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>
Thu, 29 Apr 2021 18:34:05 +0000 (14:34 -0400)
commit58a92b789a77cdade1f41800efebf6e0686f9982
tree480dac0f25d2e61c62b283b6090bb9c5ddf78588
parenta9fc64d8120937c5c37e1cacb2f55ae196e8897d
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.
gcc/cp/class.c
gcc/cp/decl.c
gcc/testsuite/g++.old-deja/g++.law/union4.C