From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4AF5C3858C2C; Thu, 10 Mar 2022 05:16:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4AF5C3858C2C From: "bugmenot at mailinator dot com" To: gdb-prs@sourceware.org Subject: [Bug c++/28952] New: Incorrect overload detected for function returning std::string ([abi:cxx11]) Date: Thu, 10 Mar 2022 05:16:02 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: c++ X-Bugzilla-Version: 10.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: bugmenot at mailinator dot com X-Bugzilla-Status: UNCONFIRMED 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: 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://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, 10 Mar 2022 05:16:02 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28952 Bug ID: 28952 Summary: Incorrect overload detected for function returning std::string ([abi:cxx11]) Product: gdb Version: 10.1 Status: UNCONFIRMED Severity: critical Priority: P2 Component: c++ Assignee: unassigned at sourceware dot org Reporter: bugmenot at mailinator dot com Target Milestone: --- Similar bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D19436 To reproduce: =3D=3D=3D file: a.cpp ``` #include struct A {}; struct B {}; std::string function(A){ return "A"; } std::string function(B){ return "B"; } int main(){ A a {}; B b {}; __builtin_trap(); } ``` Compile with `g++ -g a.cpp`, then execute `run` then `function(a)` in gdb. Actual result: "B" Expected result: "A" With `-D_GLIBCXX_USE_CXX11_ABI=3D0` the bug does not happen. --=20 You are receiving this mail because: You are on the CC list for the bug.=