Re: [cxx-abi-dev] Proposed ABI changes for new C++0x SFINAE rules
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cxx-abi-dev] Proposed ABI changes for new C++0x SFINAE rules
- To: cxx-abi-dev@xxxxxxxxxxxxxxxx
- Subject: Re: [cxx-abi-dev] Proposed ABI changes for new C++0x SFINAE rules
- From: David Vandevoorde <daveed@xxxxxxx>
- Date: Thu, 16 Sep 2010 14:43:03 -0400
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