[cxx-abi-dev] Proposed ABI changes for new C++0x SFINAE rules

Jason Merrill jason at redhat.com
Thu Sep 16 17:10:56 UTC 2010


On 09/16/2010 09:55 AM, David Vandevoorde wrote:
>>   I guess that means the compiler needs to track both the full expression and its constant value, and so on through array types and template-ids that use them.
>
> I'm not sure I understand this point.  Mostly (for this purpose), the compiler has to track the "instantiation-dependent" property for the expression.

Say you have

template <int I>
struct A;

template <> struct A<sizeof(size_t)>
{
   typedef size_t type;
};

template <class T>
void f (A<sizeof(sizeof(T))>::type);

--------------

The compiler needs to recognize that A<sizeof(sizeof(T))> is not a 
dependent type, so we need to treat it as A<8> and not require typename 
to name the nested type.  But for substitution we need to treat it as 
A<sizeof(sizeof(T))>.

Jason



More information about the cxx-abi-dev mailing list