From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B72173858287; Tue, 28 Nov 2023 19:22:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B72173858287 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701199357; bh=lp009qVDImiylYehusaEeYI27zAWhcusrDnPaRxNKJo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=arrTfTUPBRuGEo9ekgNue1d1ONwKbJgjOadSVJcSadZeRBIMIxT7hL0OMNJEl18We U/GkO5PiMLw9XqPDRkQ5wndiIqdUo2lnRWQzNcL95kb623WFACW3JnQ/yRHtaD9Dpp Qop7tQXATNhB56fdsl2X31OxC/lDy0OQV2kM78EY= From: "mpolacek at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/112744] Nested name specifier wrongly produces ambiguity in accessing static field Date: Tue, 28 Nov 2023 19:22:37 +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: 13.2.1 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: mpolacek at gcc dot gnu.org X-Bugzilla-Status: NEW 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_status everconfirmed cf_reconfirmed_on cc 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=3D112744 Marek Polacek changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed| |2023-11-28 CC| |mpolacek at gcc dot gnu.org --- Comment #1 from Marek Polacek --- Confirmed, I think. Since a is static, there is only one copy. So it shou= ld not matter that A is an ambiguous base of D (which it is). See [class]/not= e-3. For the error line, in finish_class_member_access_expr scope will be A, so = we do 3496 /* Find the base of OBJECT_TYPE corresponding to SCOPE. */ 3497 access_path =3D lookup_base (object_type, scope, ba_check, 3498 NULL, complain); where object_type=3DD, scope=3DA. But the ba_check means we give an error. We don't know at this point that name refers to a static data member. But = we can look it up, and maybe use ba_any. Not a regression.=