[cfe-commits] [patch] Mention "put ambiguous fixits on notes" in internals manual

Chandler Carruth chandlerc at google.com
Mon Jun 4 10:50:05 PDT 2012


On Mon, Jun 4, 2012 at 10:42 AM, Nico Weber <thakis at chromium.org> wrote:

> Hi,
>
> several threads on this list discussed that fixits on errors and warnings
> have to be very likely correct. "did you mean" fixits on the other hand
> should go on a separate note instead. The attached patch adds this to the
> internals manual.
>

This is great, but we need to go further really.

There is another reason why not to attach a fixit hint to an error or
warning: doing so is *required* to recover the parse as-if the fixit hint
had been applied.

For errors, this is reasonably easy to achieve. We just insist that if we
can emit a fixit hint, we recover in the parser as-if.

For warnings, this is almost impossible. It can only be done when the
suggested fixit has zero semantic impact on the AST produced. There are
only a few cases, for example changing 'struct' to 'class' in a *forward*
declaration. This makes fixit hints only rarely get attached to warnings.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120604/103fa943/attachment.html>


More information about the cfe-commits mailing list