Pointer-to-member-function mangling

Mark Mitchell mark at codesourcery.com
Sat Oct 19 00:43:53 UTC 2002


Consider this example:

  typedef void T ();

  struct S {
  };

  void f (T*, T (S::*)) {}

To make sure everyone's on the same page, the second parameter is a
pointer to a member function of S whose return type is void and which
has no parameters.

The question is whether when mangling the pointer-to-member, you treat
the member function type as equivalent to the function type pointed to
by the first argument, for the purposes of substitution.

In other words, is the type of a non-static member function the same
as the type of a non-member function with the same prototype, for the
purposes of substitution?

I think the answer ought to be that these two types are *not* the
same, and G++ agrees with me. :-)

If your compiler produces this output:

  _Z1fPFvvEM1SFvvE

then your compiler agrees too.

HP, Intel, do either of your compilers produce a different name?

If not, I will clarify the spec.  If they do, we'll see what mode is
more prevalent.

--
Mark Mitchell                   mark at codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com




More information about the cxx-abi-dev mailing list