[cxx-abi-dev] Mangling of sizeof when applied to a type
Daveed Vandevoorde
daveed at edg.com
Fri Jun 28 02:31:31 UTC 2002
Chris Lattner wrote:
>
> > 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)>);
>
> Are f<sizeof(int32_t)> and f<4> different instantiations? If not, why not
> evaluate the size, then mangle?
You need to mangle the generic form. The following function templates (and
their instantiations) might coexist:
template<typename X> void f(S<sizeof(X)>);
template<typename X> void f(S<X::size>);
For a given X, X::size and sizeof(X) may evaluate to the same value, but
the templates must instantiate to distinct entities.
Daveed
More information about the cxx-abi-dev
mailing list