This program

  class Source;
  class Dest;

  struct converter
  {
    converter(Source *s) {}
    template<class D> operator D*();
  };

  Dest* f(Source* s) { return converter(s); }

when compiled by several different versions of g++ (I tried 4.3.4 and 4.4.1;
the person who asked me to reduce the test case found the problem on OSX with
some version of Apple-modified gcc 4.2), produces this symbol name for the
conversion operator:

  _ZN9convertercvPT_I4DestEEv

c++filt from binutils 2.19 will not demangle this symbol.  I have not been able
to figure out for certain whether this is an incorrect mangling, a demangler
bug, or both.  These variations demangle to close approximations of the right
thing:

  _ZN9convertercvT_IN4DestEEEv -> converter::operator Dest<Dest>()
  _ZN9convertercvT_IPN4DestEEEv -> converter::operator Dest*<Dest*>()

but 

  _ZN9convertercvPT_IN4DestEEEv

does not demangle, either.


-- 
           Summary: Templated conversion operator produces symbol name that
                    won't demangle
           Product: gcc
           Version: 4.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: zackw at panix dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41233

Reply via email to