https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46206
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=19538 Keywords| |rejects-valid --- Comment #11 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Nathan Keynes from comment #0) > but accepts many similar examples, including: > class Foo > { > bool a, b, c; > typedef struct Bar { } Bar; > virtual void foo(void) { > struct Bar bar; > } > }; That is no longer accepted, since r252005. So the difference was possibly a bug, which got fixed, and now we consistently reject both, but ... > I'm uncertain if this is strictly legal or not per the standard, but it > doesn't seem to make sense to accept one of these cases but not the other. It was made legal by https://wg21.link/cwg407 (c.f. PR 19538). Both examples should compile.