[cxx-abi-dev] Proposed ABI changes for new C++0x SFINAE rules
David Vandevoorde
daveed at edg.com
Thu Sep 16 18:43:03 UTC 2010
On Sep 16, 2010, at 1:10 PM, Jason Merrill wrote:
> 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))>.
Ah yes, that's correct.
Daveed
More information about the cxx-abi-dev
mailing list