From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4A19A386D606; Tue, 28 Nov 2023 09:01:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4A19A386D606 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701162074; bh=lvFBeC55eDRteBUEUsMug7uQolj6zJtfLOH292c5d6I=; h=From:To:Subject:Date:From; b=iZbd5wqu8ESn8u2yN09Soqs+EJgW+Pbx3/9dK1BqFqmZpCHWCNJCHOabrjmwgV6NR j+zFPhL6o2tJix5iBwFp7Rz8oi8X6kvknICCYoTRHgZWNFUvWp5L33cLQT3JmjbbYk IcL5iGav+XctWMHje3yeCu3eLfXV8e/SQvqv/78M= From: "fchelnokov at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/112744] New: Nested name specifier wrongly produces ambiguity in accessing static field Date: Tue, 28 Nov 2023 09:01:13 +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: 13.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fchelnokov at gmail dot com 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 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=3D112744 Bug ID: 112744 Summary: Nested name specifier wrongly produces ambiguity in accessing static field Product: gcc Version: 13.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: fchelnokov at gmail dot com Target Milestone: --- This program struct A { constexpr static int a =3D 0; }; struct B : A {}; struct C : A {}; struct D : B, C {}; int main() { (void)D{}.a; //ok everywhere (void)D{}.A::a; //error in GCC } is accepted in Clang and MSVC, but GCC fails on the line with nested name specifier: error: 'A' is an ambiguous base of 'D' Online demo: https://godbolt.org/z/vY6rjd9fx=