https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67263
Bug ID: 67263 Summary: demangler mishandles const qualifier on template parameter with function type 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: --- The demangler has code to convert from DEMANGLE_COMPONENT_CONST to DEMANGLE_COMPONENT_CONST_THIS when the const refers to a function type (see the bottom of d_cv_qualifiers). However, this conversion does not occur when the const qualifier is on a template parameter that happens to expand to a function type. Here is a symbol that shows the problem: _ZN1C12_GLOBAL__N_11DIFbPKNS_1EEEEEvPNS_1FERKT_ The demangler turns that into this: void C::(anonymous namespace)::D<bool (C::E const*)>(C::F*, bool ( const&)(C::E const*)) It should produce this: void C::(anonymous namespace)::D<bool (C::E const*)>(C::F*, bool (&)(C::E const*) const)