}
/// ParseExternalDeclaration:
+///
/// external-declaration: [C99 6.9], declaration: [C++ dcl.dcl]
/// function-definition
/// declaration
ConsumeToken();
// TODO: Invoke action for top-level semicolon.
return 0;
+ case tok::r_brace:
+ Diag(Tok, diag::err_expected_external_declaration);
+ ConsumeBrace();
+ return 0;
+ case tok::eof:
+ Diag(Tok, diag::err_expected_external_declaration);
+ return 0;
case tok::kw___extension__: {
// __extension__ silences extension warnings in the subexpression.
ExtensionRAIIObject O(Diags); // Use RAII to do this.
case tok::kw_export: // As in 'export template'
// A function definition cannot start with a these keywords.
return ParseDeclaration(Declarator::FileContext);
+
default:
// We can't tell whether this is a function-definition or declaration yet.
return ParseDeclarationOrFunctionDefinition();