From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A69F03858D35; Thu, 4 May 2023 21:46:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A69F03858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683236804; bh=SZZpMKfvVBZiyxTTHBAxuoybRgN/h2D2yzUaF9DL2k0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GlASvu9ssr3zQfvmaCMK06JGuM1j1SsCxIj11pILz1Xd5KxrOyQ7ZkqNxnH2Ye5lq atEoMVtbVW+rG/8lpRfhcpGi7zhm9MbvEuNVVZBUYOfvnMoVGHgx91uLZly/4aZ8Lo oM/Pd72NAkQoSrb+pNjZ37gv8L6Ag77yxupZZt00= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/100918] [10 Regression] Naming a destructor as a qualified template-id results in bogus access error Date: Thu, 04 May 2023 21:46:44 +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: 11.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.5 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=3D100918 --- Comment #8 from Andrew Pinski --- (In reply to Christian Prochaska from comment #7) > Since the commit above the following test fails. Is this correct? >=20 > class T1 { }; > class T2 { }; >=20 > template > class A { }; >=20 > class B : A { }; >=20 > class C : B > { > class D : A { }; > }; >=20 > test.cc:11:19: error: =E2=80=98class A A::A=E2=80=99 is private w= ithin this context > 11 | class D : A { }; > | ^~~~~ > test.cc:7:7: note: declared private here > 7 | class B : A { }; > | ^ Yes it should be rejected as A is a private name of A and A is priv= ate to B. clang rejects it for the same reason though has a better error messag= e: :12:19: error: 'A' is a private member of 'A' class D : A { }; ^ :8:11: note: constrained by implicitly private inheritance here class B : A { }; ^~~~~ :6:7: note: member is declared here class A { }; ^=