[cfe-commits] [Patch] Add checking for '(' after '::' - fixes crash as reported in PR11852

David Blaikie dblaikie at gmail.com
Fri Oct 5 15:18:14 PDT 2012


Minor point: misspelled "ColonColon" as "ColocColon".
"GetLookAheadToken(0)" is synonymous with "getCurToken" as far as I
know (& the latter's infinitely more common)

Other than that it all looks reasonable - I assume creating a removal
for a default SourceLocation (in the case where there is no right
paren to remove) isn't problematic (& just does nothing/is silent)?
(judging by your test cases I assume it works fine, but I didn't
build/run it myself to check)

Otherwise the only issue to me is whether this is the best error
recovery, but that's probably best left to experimentation.

On Fri, Oct 5, 2012 at 2:18 PM, Richard Trieu <rtrieu at google.com> wrote:
> Clang was crashing when encountering a '(' after '::'.  This patch will
> allow Clang to detect this code, remove the parens from the token stream,
> and emit an error with a fix it.  This will fix PR11852.
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>



More information about the cfe-commits mailing list