[PATCH?] 'this' in typedefs, possibly overly complicated code in other 'this' checks?

Harald van Dijk harald at gigawatt.nl
Thu Jan 16 23:44:28 PST 2014


On 17/01/14 01:03, Alp Toker wrote:
> On 16/01/2014 06:38, Harald van Dijk wrote:
>> Ah, thanks, you're right. If the in-class declaration doesn't use
>> 'this', but the definition does, then 'this' would not be diagnosed with
>> my approach.
> 
> Hi Harald,
> 
> If you have the time could you throw together a couple of tests for
> those cases as well?
> 
> checkThisInStaticMemberFunctionAttributes() looks like it can be dropped
> now that RecursiveASTVisitor visits attributes (r198224) so I'm hopeful
> we can still apply the bulk of the cleanup from your original patch
> without regressing.

Hi Alp,

I am hoping to have some spare time soon to look more closely at what
needs to be changed in order to merge the two separate checks for uses
of 'this', but if that takes too long I will be happy to send a patch
that just adds test cases and cleans up less than I would have hoped.

Cheers,
Harald van Dijk

>> Normally, if the definition does, so would the in-class
>> declaration, where it would be diagnosed, but an example of where it
>> doesn't is
>>
>> struct Foo {
>>    static bool f();
>> };
>>
>> auto Foo::f() -> decltype(this != 0) {
>>    return true;
>> }



More information about the cfe-commits mailing list