Bug 61805

Summary: Demangler crash (GDB PR 17157)
Product: gcc Reporter: Gary Benson <gbenson>
Component: demanglerAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: mark
Priority: P3    
Version: unknown   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:

Description Gary Benson 2014-07-15 08:38:21 UTC
The demangler crashes when given this symbol:

_ZNK5niven5ColorIfLi4EEdvIfEENSt9enable_ifIXsrSt13is_arithmeticIT_E5valueEKNS0_IDTmlcvS5__Ecvf_EELi4EEEE4typeES5_

See https://sourceware.org/bugzilla/show_bug.cgi?id=17157
Comment 1 gcc-bugzilla 2015-02-08 20:08:05 UTC
Some more comments, copied from the GDB bug report:

Ok, this problem is a bit more complicated. First, a newer GCC (4.9.1) and Clang 3.5 doesn't produce the symbol any more. Running a more recent c++filt on it now crashes c++filt -- if you look closely, the originally demangled type was also incorrect, as: decltype (((float)()*(float)())) does not make sense -- should have been decltype (float ()*float ()) which is simply float.

I'm debugging a new crash now where the demangler/libiberty starts producing a symbol name with decltype in it, which I strongly suspect is similar to the original issue. Am I right to assume that decltype is never part of a mangled symbol name?
Comment 2 Mark Wielaard 2016-12-04 22:38:48 UTC
GNU c++filt (GNU Binutils) 2.27.51.20161118 doesn't crash and demangles it to:

std::enable_if<std::is_arithmetic<float>::value, niven::Color<decltype (((float)())*((float)())), 4> const>::type niven::Color<float, 4>::operator/<float>(float) const
Comment 3 Markus Trippelsdorf 2017-03-09 08:50:58 UTC
fixed