From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 638423858425; Fri, 23 Feb 2024 08:09:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 638423858425 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708675757; bh=8hUbO6Jo0etisLyu5Yk3slL6E1O1bSNGKN01ghbjlgY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=F8Pn6kEy145sktI5cCN+1d2wgya1Pt32iQQM5SIvvFdnlDKTgeyf+14xV+VyDFI52 UszmHSwz54+YJ8ndoyDZFgtQf+JeY8r6bP42EMTgW0yLS6Zzn4sQX9YFUVCws+lLGh 7SMf3ifPAW8hIEM8wlZ8Y0ZufByf2u3zDiII8JUU= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114067] GCC gives wrong diagnostic in the definition of a static data member of same class type Date: Fri, 23 Feb 2024 08:09:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114067 --- Comment #4 from Andrew Pinski --- (In reply to Jason Liam from comment #3) > (In reply to Andrew Pinski from comment #2) > > Actually A at that point is incomplete type. >=20 > 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 becaus= e it seems like the check for completeness happens way before in a different function.=