From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6E8F13858C39; Fri, 14 Oct 2022 02:06:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6E8F13858C39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665713219; bh=DF031maZx/eff8xTqW+bjCTu/gaFSkXnbcDQ+ZP9UQc=; h=From:To:Subject:Date:From; b=aHgde6vEIAQPF8EloPQI5NvHqEQfVcR69aGV6UAeswb4O98j3sPlulFRuPFCsI5RG iFqUitypo9gzxoQih9lrC5oSjr5R+1MBQm0vfpt6N9cxOq0OndudQcJ/UP2SKX05Th d7WusDhg+olzxTxf9o2YJU+21aa9cjaLfuZpTZjM= From: "de34 at live dot cn" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107256] New: Contradictory circular noexcept-specifier is accepted Date: Fri, 14 Oct 2022 02:06:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: accepts-invalid X-Bugzilla-Severity: normal X-Bugzilla-Who: de34 at live dot cn 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: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D107256 Bug ID: 107256 Summary: Contradictory circular noexcept-specifier is accepted Product: gcc Version: 12.2.0 Status: UNCONFIRMED Keywords: accepts-invalid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: de34 at live dot cn Target Milestone: --- This code snipet is currently accepted by gcc while the noexcept-specifier cannot be meaningful. struct Weird { static void f() noexcept(!noexcept(Weird::f())) {} }; Godbolt link: https://godbolt.org/z/hqnha3aPd The code was rejected by gcc 9 and earlier versions, but with a seemly incorrect reason (error: incomplete type 'Weird' used in nested name specifier). According to CWG DR 1330 and current wording in [class.mem.gene= ral] /7, the noexcept-specifier establishes a complete-class context, so Weird is complete inside it.=