https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67267
Bug ID: 67267 Summary: demangler does not handle "sr" correctly Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ian at airs dot com CC: gbenson at redhat dot com Target Milestone: --- I don't have the source for this, but g++ generated this symbol name: _ZN9__gnu_cxx17__normal_iteratorIPK1EIN1F1G1HEESt6vectorIS5_SaIS5_EEEC2IPS5_EERKNS0_IT_NS_11__enable_ifIXsr3std10__are_sameISE_SD_EE7__valueESA_E1IEEE The demangler failed to demangle it. However, this is a valid mangled name. The demangler does not handle the sr correctly. It treats sr as a type followed by a name. However, the description of sr is this: <unresolved-name> ::= [gs] <base-unresolved-name> ::= sr <unresolved-type> <base-unresolved-name> ::= srN <unresolved-type> <unresolved-qualifier-level>+ E <base-unresolved-name> ::= [gs] sr <unresolved-qualifier-level>+ E <base-unresolved-name> <unresolved-type> ::= <template-param> ::= <decltype> ::= <substitution> <unresolved-qualifier-level> ::= <simple-id> <simple-id> ::= <source-name> [ <template-args> ] <base-unresolved-name> ::= <simple-id> ::= on <operator-name> ::= on <operator-name> <template-args> ::= dn <destructor-name> In this mangled name the string following "sr" does not match <unresolved-type>, so this is the <unresolved-qualifier-level>+ E case. The demangler does not handle that case. The correct demangling is something like __gnu_cxx::__normal_iterator<E<F::G::H> const*, std::vector<E<F::G::H>, std::allocator<E<F::G::H> > > >::__normal_iterator<E<F::G::H>*>(__gnu_cxx::__normal_iterator<E<F::G::H>*, __gnu_cxx::__enable_if<std::__are_same<E<F::G::H>*, E<F::G::H>*>::__value, std::vector<E<F::G::H>, std::allocator<E<F::G::H> > > >::I> const&)