Commit a4245c17 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Improved recovering from errors inside template declarations.

parent c5d110d6
......@@ -986,7 +986,18 @@ bool Parser::parseTemplateDeclaration(DeclarationAST *&node)
match(T_GREATER, &ast->greater_token);
do {
unsigned start_declaration = cursor();
ast->declaration = 0;
if (parseDeclaration(ast->declaration))
_translationUnit->error(start_declaration, "expected a declaration");
rewind(start_declaration + 1);
} while (LA());
node = ast;
return true;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment