Mangling of sizeof when applied to a type

Mark Mitchell mark at codesourcery.com
Thu Jun 27 22:01:39 UTC 2002


The ABI document does not currently specify the mangling of sizeof when
applied to a type.  For example:

  template <typename X>
  void f(S<sizeof(X)>);

When instantiating f, we need a mangling for the argument type in the
uninstantiated form.

To that end, I suggest we introduce a new operator "st" which takes one
operand, but which is a type, rather than an expression.

This changes the mangling grammar like so:

  <expression> ::= st <type>

It's better not to overload sz since that will make demangling harder.

If I don't hear objections in the next few days, I'll make this change
to the ABI document.

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



More information about the cxx-abi-dev mailing list