[Bug c++/28952] New: Incorrect overload detected for function returning std::string ([abi:cxx11])

bugmenot at mailinator dot com sourceware-bugzilla@sourceware.org
Thu Mar 10 05:16:02 GMT 2022


https://sourceware.org/bugzilla/show_bug.cgi?id=28952

            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=19436

To reproduce:

=== file: a.cpp
```
#include<string>

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=0` the bug does not happen.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Gdb-prs mailing list