Mangling of template conversion ops

Jason Merrill jason at redhat.com
Fri Jun 14 14:45:57 UTC 2002


We recently received a bug report, at

  http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=65035

for the mangling of C::operator int in this testcase.

  struct C {
      template <class T>
      operator T ();
  };

  template <class T>
  C::operator T () { return 0; }

  template C::operator int ();

g++ currently emits

  _ZN1CcviIiEEv

but he argues, and I agree, that it should be

  _ZN1CcvT_IiEEv

mangling the template arg appropriately.  What do other people think?

Note, this is a forward reference, which is kind of awkward for the
demangler.  We probably should have mangled the return type of a conversion
op in the same place as other return types, to avoid this oddity.  It's too
late for this change now, of course.

Jason



More information about the cxx-abi-dev mailing list