[cfe-dev] Q. on recent fixit changes

Richard Smith richard at metafoo.co.uk
Wed Dec 17 11:30:45 PST 2014


On Mon, Dec 15, 2014 at 3:51 PM, Robinson, Paul <
Paul_Robinson at playstation.sony.com> wrote:

> I've seen a difference in whether some fixits are produced, recently
> (i.e. sometime between r222093 and r222640).  Mainly I want to know
> whether it's intentional, given the recent changes to fixit handling
> (which I didn't really pay much attention to).  If it's intentional,
> cool, I'll just update my tests; but if it isn't, then I can file a
> bug so somebody can look into it.
>
> Given the following source:
>
> namespace std {
>   void *junk();
> };
> int main() {
>   delete junk;
>   return 0;
> }
>
> This used to get an error with a fixit:
>
> try.cpp:8:10: error: use of undeclared identifier 'junk'; did you mean
>       'std::junk'?
>   delete junk;
>          ^~~~
>          std::junk
> try.cpp:4:9: note: 'std::junk' declared here
>   void *junk();
>         ^
> try.cpp:8:3: error: cannot delete expression of type 'void *()'
>   delete junk;
>   ^      ~~~~
> 2 errors generated.
>
>
> Now it doesn't:
>
> try.cpp:8:10: error: use of undeclared identifier 'junk'
>   delete junk;
>          ^
> 1 error generated.


This is intentional. Note that the old fixit was wrong. We now try to only
issue fixits if they don't result in further errors.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141217/44dae356/attachment.html>


More information about the cfe-dev mailing list