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

Richard Smith richard at metafoo.co.uk
Tue Mar 24 15:31:30 PDT 2015


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.

Can someone please help?  Thanks!
>
>
> REPOSITORY
>   rL LLVM
>
> http://reviews.llvm.org/D6828
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150324/ea2e3b1b/attachment.html>


More information about the cfe-commits mailing list