[cfe-dev] Q. on recent fixit changes

David Blaikie dblaikie at gmail.com
Mon Dec 15 16:26:25 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.
>

As I understand it, this is intentional - we try not to suggest fixits that
would produce cascading failures. Typo correction has recently been
improved along those lines, to delay typo correction until the end of the
full expression - thus allowing more accurate typo corrections (ones that
actually make the whole expression successfully compile) & so we should see
some new cases of suggestions and some cases where bad suggestions no
longer appear.

- David


>
> Thanks,
> --paulr
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141215/df787660/attachment.html>


More information about the cfe-dev mailing list