[PATCH] Diagnose declspecs occuring after virt-specifier-seq and generate fixit hints

Ehsan Akhgari ehsan.akhgari at gmail.com
Tue Mar 24 17:37:37 PDT 2015


On Tue, Mar 24, 2015 at 6:31 PM, Richard Smith <richard at metafoo.co.uk>
wrote:

>
> On Tue, Mar 24, 2015 at 2:28 PM, Ehsan Akhgari <ehsan.akhgari at gmail.com>
> wrote:
>
>> I'm having difficulty fixing the issue that caused this patch to bounce
>> when I landed it earlier this morning.  Here is a link to the log of the
>> test failure:
>> http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/24611/steps/check-all/logs/FAIL%3A%20Clang%3A%3Afixit-cxx0x.cpp
>>
>> The issue is my call to getFunctionTypeInfo().  That call is now
>> asserting because isFunctionDeclarator() returns false on the declaration.
>> I checked, and isDeclarationOfFunction() returns true, but I'm not sure how
>> to get a FunctionTypeInfo out of such a declarator.
>>
>
> You can't; there isn't one. Consider:
>
> typedef int F() const;
>
> struct X {
>   virtual F f final volatile;
> };
>
> The declaration of X::f doesn't have a function declarator. The simplest
> way out of this would be to skip your new recovery path if your Declarator
> is not a function declarator.
>

Thanks, I understand now.  Your advice helped me fix this issue!

-- 
Ehsan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150324/a7279964/attachment.html>


More information about the cfe-commits mailing list