[PATCH] PR16225 - Assert-on-invalid: isa<LabelDecl>(D) && "declaration not instantiated in this scope"
Serge Pavlov
sepavloff at gmail.com
Thu Jun 6 00:41:23 PDT 2013
Yes, this fix solves two problems, - avoiding spurious messages in parser and assert violation in semantic analyzer. I'll split the patch accordingly.
================
Comment at: lib/Parse/ParseDeclCXX.cpp:921
@@ -921,1 +920,3 @@
+ if (!Template) {
+ SkipUntil(tok::greater, /*StopAtSemi=*/true, /*DontConsume=*/false);
return true;
----------------
Richard Smith wrote:
> This might stop too early (if there are nested templates) or too late (if the template-id ends with tok::greatergreater). Maybe skip until tok::l_brace?
Skipping to tok::l_brace would leave errors in usage of other parent classes unnoticed. Luckily skipUntil is smart enough and the case of template arguments is handled right. However, tok::greatergreater is not handled properly, this case will be taken into account in separate parser fix.
http://llvm-reviews.chandlerc.com/D920
More information about the cfe-commits
mailing list