[cfe-commits] [PATCH] PR7606: Diagnostic for ',' instead of '; ' at the end of a statement

Richard Smith richard at metafoo.co.uk
Mon Sep 17 17:55:07 PDT 2012


On Mon, Sep 17, 2012 at 7:58 AM, Ahmed Bougacha <ahmed.bougacha at gmail.com>wrote:

> Hi,
>
> On Tue, Sep 11, 2012 at 7:35 AM, Richard Smith <richard at metafoo.co.uk>
> wrote:
> >
> > It looks like you're now consuming the ',' before bailing out. I'm not
> sure
> > whether that's detectable, but you should leave it in the token stream
> > anyway so other parts of the compiler can recover better (for instance,
> we
> > could offer a ',' -> ';' typo correction in this situation by extending
> > IsCommonTypo). Given that you're now looking a couple of tokens past the
> > comma, it'll be best to go back to your former approach of putting it
> back
> > into the token stream if you find that it's a typo.
>
> We reverted back to leaving the comma, which, when handled by
> IsCommonTypo, gives the expected errors.
>

Thanks! I've checked this in as r164085, along with some more test cases. I
also moved the isDeclarationStatement checks to a new Parser method,
isKnownToBeDeclarationSpecifier.

-- Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120917/8fb2ebdc/attachment.html>


More information about the cfe-commits mailing list