From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 993BE3858439; Thu, 4 Nov 2021 17:56:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 993BE3858439 From: "simark at simark dot ca" To: gdb-prs@sourceware.org Subject: [Bug gdb/28480] pretty printing getting confused Date: Thu, 04 Nov 2021 17:56:57 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simark at simark dot ca X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot 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://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Nov 2021 17:56:57 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28480 --- Comment #14 from Simon Marchi --- (In reply to Jonathan Wakely from comment #12) > Aha, the std::tuple case is more like this: >=20 > struct X > { > int i =3D 0x1; > }; >=20 > struct Y > { > struct S { }; > [[no_unique_address]] S i; > }; >=20 > struct XX : X { }; >=20 > struct Z : Y, XX { }; >=20 > int main() > { > Z z; > return 0; > } I think you can get rid of XX (make Z directly inherit from X) and it still reproduces. >=20 > Here z.i is ambiguous, but GDB doesn't diagnose it. >=20 > And GDB 10 returns z.X::i but GDB 11 returns z.Y::i If I try to use z.i in the program, it doesn't compile: test.cpp: In function =E2=80=98int main()=E2=80=99: test.cpp:17:12: error: request for member =E2=80=98i=E2=80=99 is ambiguous 17 | return z.i; | ^ test.cpp:3:7: note: candidates are: =E2=80=98int X::i=E2=80=99 3 | int i =3D 0x1; | ^ test.cpp:9:27: note: =E2=80=98Y::S Y::i=E2=80=99 9 | [[no_unique_address]] S i; | ^ So I agree, it makes sense for GDB to not accept the expression. It looks = like the intent is to reject and (and print the "request is ambiguous" message),= but that the no_unique_address tag confuses GDB. --=20 You are receiving this mail because: You are on the CC list for the bug.=