This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/78761] New: C++14, compiler generate mangled name that can not be demangled
- From: "chihin.ko at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 10 Dec 2016 04:45:17 +0000
- Subject: [Bug c++/78761] New: C++14, compiler generate mangled name that can not be demangled
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78761
Bug ID: 78761
Summary: C++14, compiler generate mangled name that can not be
demangled
Product: gcc
Version: 6.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: chihin.ko at oracle dot com
Target Milestone: ---
cat t.cc
template <class T>
decltype(auto) g_1(T t) {
return t;
}
template <class T>
auto g_2(T t) {
return t;
}
int main() {
decltype(auto) res = g_1<int>(10);
decltype(auto) res2 = g_2<int>(10);
return 0;
}
==========================================
g++ -g t.cc
> nm a.out | grep g_2
[71] | 4198535| 12|FUNC |WEAK |0 |20 |_Z3g_2IiEDaT_
> /pkg/gnu/bin/gnu-c++filt _Z3g_2IiEDaT_
auto g_2<int>(int) <=== this is OK
> nm a.out | grep g_1
[84] | 4198523| 12|FUNC |WEAK |0 |19 |_Z3g_1IiEDcT_
> /pkg/gnu/bin/gnu-c++filt _Z3g_1IiEDcT_
_Z3g_1IiEDcT_ <=== can not be demangled