|
@@ -623,6 +623,8 @@ void Parser::ParseObjCInterfaceDeclList(tok::ObjCKeywordKind contextKey,
|
|
}
|
|
}
|
|
// Ignore excess semicolons.
|
|
// Ignore excess semicolons.
|
|
if (Tok.is(tok::semi)) {
|
|
if (Tok.is(tok::semi)) {
|
|
|
|
+ // FIXME: This should use ConsumeExtraSemi() for extraneous semicolons,
|
|
|
|
+ // to make -Wextra-semi diagnose them.
|
|
ConsumeToken();
|
|
ConsumeToken();
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
@@ -646,7 +648,19 @@ void Parser::ParseObjCInterfaceDeclList(tok::ObjCKeywordKind contextKey,
|
|
// erroneous r_brace would cause an infinite loop if not handled here.
|
|
// erroneous r_brace would cause an infinite loop if not handled here.
|
|
if (Tok.is(tok::r_brace))
|
|
if (Tok.is(tok::r_brace))
|
|
break;
|
|
break;
|
|
|
|
+
|
|
ParsedAttributesWithRange attrs(AttrFactory);
|
|
ParsedAttributesWithRange attrs(AttrFactory);
|
|
|
|
+
|
|
|
|
+ // Since we call ParseDeclarationOrFunctionDefinition() instead of
|
|
|
|
+ // ParseExternalDeclaration() below (so that this doesn't parse nested
|
|
|
|
+ // @interfaces), this needs to duplicate some code from the latter.
|
|
|
|
+ if (Tok.isOneOf(tok::kw_static_assert, tok::kw__Static_assert)) {
|
|
|
|
+ SourceLocation DeclEnd;
|
|
|
|
+ allTUVariables.push_back(
|
|
|
|
+ ParseDeclaration(DeclaratorContext::FileContext, DeclEnd, attrs));
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+
|
|
allTUVariables.push_back(ParseDeclarationOrFunctionDefinition(attrs));
|
|
allTUVariables.push_back(ParseDeclarationOrFunctionDefinition(attrs));
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
@@ -1875,6 +1889,7 @@ void Parser::HelperActionsForIvarDeclarations(Decl *interfaceDecl, SourceLocatio
|
|
/// ';'
|
|
/// ';'
|
|
/// objc-instance-variable-decl-list objc-visibility-spec
|
|
/// objc-instance-variable-decl-list objc-visibility-spec
|
|
/// objc-instance-variable-decl-list objc-instance-variable-decl ';'
|
|
/// objc-instance-variable-decl-list objc-instance-variable-decl ';'
|
|
|
|
+/// objc-instance-variable-decl-list static_assert-declaration
|
|
/// objc-instance-variable-decl-list ';'
|
|
/// objc-instance-variable-decl-list ';'
|
|
///
|
|
///
|
|
/// objc-visibility-spec:
|
|
/// objc-visibility-spec:
|
|
@@ -1945,6 +1960,15 @@ void Parser::ParseObjCClassInstanceVariables(Decl *interfaceDecl,
|
|
return cutOffParsing();
|
|
return cutOffParsing();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // This needs to duplicate a small amount of code from
|
|
|
|
+ // ParseStructUnionBody() for things that should work in both
|
|
|
|
+ // C struct and in Objective-C class instance variables.
|
|
|
|
+ if (Tok.isOneOf(tok::kw_static_assert, tok::kw__Static_assert)) {
|
|
|
|
+ SourceLocation DeclEnd;
|
|
|
|
+ ParseStaticAssertDeclaration(DeclEnd);
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+
|
|
auto ObjCIvarCallback = [&](ParsingFieldDeclarator &FD) {
|
|
auto ObjCIvarCallback = [&](ParsingFieldDeclarator &FD) {
|
|
Actions.ActOnObjCContainerStartDefinition(interfaceDecl);
|
|
Actions.ActOnObjCContainerStartDefinition(interfaceDecl);
|
|
// Install the declarator into the interface decl.
|
|
// Install the declarator into the interface decl.
|