On Mon, Jun 4, 2012 at 10:42 AM, Nico Weber <[email protected]> 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.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to