[cxx-abi-dev] Mangling sizeof

Dennis Handly dhandly at cup.hp.com
Thu Mar 5 02:40:33 UTC 2009


>From: Jason Merrill <jason at redhat.com>
>This would break ABI compatibility with most existing uses of sizeof
>in template signatures, but I suspect those are very few currently because
>of the limitations of expression mangling 

Are you talking about something simple like this use of sizeof being
incompatible?

void foo<int>(int*, A<sizeof (int)>) => _Z3fooIiEvPT_1AIXstS0_EE

template <unsigned long size> struct A {};
template <class T>
void foo(T*, A<sizeof(T)>) {}
int main() {
   A<sizeof(int)> x;
   foo<int>(0, x);
}



More information about the cxx-abi-dev mailing list