Bug 78349 - function returning std::basic_string<char> missing [abi:cxx11] tag
Summary: function returning std::basic_string<char> missing [abi:cxx11] tag
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 5.4.0
: P3 normal
Target Milestone: 6.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ABI
Depends on:
Blocks:
 
Reported: 2016-11-14 17:23 UTC by Trevor Highland
Modified: 2016-11-26 21:37 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Trevor Highland 2016-11-14 17:23:47 UTC
test.cc:
#include <string>

template <class T>
class foo {
    public:
    std::basic_string<T> bar() {
        return "";
    }
};

foo<char> baz;
auto y = baz.bar();

Compiler command:
g++-5 -c -std=c++14 test.cc -o test.o

Result:
nm test.o |c++filt| grep bar
0000000000000000 W foo<char>::bar()

Expected:
nm test.o |c++filt| grep bar
0000000000000000 W foo<char>::bar[abi:cxx11]()
Comment 1 Jonathan Wakely 2016-11-15 15:42:57 UTC
I think this is a known issue and intentionally not fixed on the GCC 5 branch (but it is fixed for GCC 6).

N.B. GNU nm has a -C option to demangle so you don't need c++filt.
Comment 2 Andrew Pinski 2016-11-26 21:37:03 UTC
Fixed.