https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114067
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Jason Liam from comment #3) > (In reply to Andrew Pinski from comment #2) > > Actually A at that point is incomplete type. > > Yes, it is incomplete at that point but that is not the reason for the > program to be ill-formed. The reason is that `A` is a class-type and not an > integral/enumeration type. As I mentioned there is a extension which allows it be accepted (only with -fpermissive) if it was complete. And the checking for it being complete happens before that other check. Now I fully looked into how fix this so the diagnostic for the completeness happens after allowing the extension because it seems like the check for completeness happens way before in a different function.