https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63370
Bug ID: 63370 Summary: abi::__cxa_demangle fails when demangling globally defined lambda (or typeid.name returns wrong value) Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: other Assignee: unassigned at gcc dot gnu.org Reporter: vprimachenko at ya dot ru Created attachment 33561 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33561&action=edit sample code which reproduces the bug a c++11 lambda expression `[]()->void{}` defined in the `main` function gets `Z4mainEUlvE_` as typeid.name which can be demangled to `main::{lambda()#1}` using `abi::__cxa_demangle`. However a globally defined lambda gets reported as just `UlvE_` and the demangle function fails with status code of -2 (error "mangled_name is not a valid name under the C++ ABI mangling rules.")