[cfe-commits] [patch] Support decltype in destructor calls

Eli Friedman eli.friedman at gmail.com
Thu Dec 8 01:32:32 PST 2011


On Thu, Dec 8, 2011 at 12:39 AM, David Blaikie <dblaikie at gmail.com> wrote:
> On Thu, Dec 8, 2011 at 12:31 AM, Eli Friedman <eli.friedman at gmail.com> wrote:
>> On Wed, Dec 7, 2011 at 9:58 PM, David Blaikie <dblaikie at gmail.com> wrote:
>>>> Also, I think you need to check if the T is dependent.
>>>
>>> Hmm - I've tried a few things, but I think that's not an issue for
>>> now. It seems like any dependent type on the left of the '.' or '->'
>>> goes through the pseudo destructor path (see
>>> Sema::ActOnStartCXXMemberReference - first thing it does is check if
>>> it's a dependent type and sets MayBePseudoDestructor to true). So if
>>> the rhs is dependent we'll just get a mismatch at the moment since the
>>> lhs is never dependent.
>>>
>>> Unless I'm missing something - perhaps there's a more specific case
>>> you had in mind?
>>
>> What about "y->~decltype(T())();" from your testcase?  It looks like
>> you're getting the error before it actually tries to instantiate the
>> template.
>
> Right - I mentioned that in passing in my original email - it's
> because clang seems to be parsing that as a pseudo destructor & I
> haven't handled those yet. I thought this might be a slightly
> smaller/easier to consume review before I go plumbing through the
> pseudo-destructor related parsing & sema.

Okay, fine; please put a FIXME into the testcase.

-Eli




More information about the cfe-commits mailing list