}
IdentifierInfo *classId = Tok.getIdentifierInfo();
SourceLocation classLoc = ConsumeToken(); // consume class-name;
- if (Tok.isNot(tok::semi)) {
- Diag(Tok, diag::err_expected_semi_after) << "@compatibility_alias";
- return 0;
- }
+ ExpectAndConsume(tok::semi, diag::err_expected_semi_after,
+ "@compatibility_alias");
return Actions.ActOnCompatiblityAlias(atLoc, aliasId, aliasLoc,
classId, classLoc);
}
break;
ConsumeToken(); // consume ','
}
- if (Tok.isNot(tok::semi)) {
- Diag(Tok, diag::err_expected_semi_after) << "@synthesize";
- SkipUntil(tok::semi);
- }
- else
- ConsumeToken(); // consume ';'
+ ExpectAndConsume(tok::semi, diag::err_expected_semi_after, "@synthesize");
return 0;
}
break;
ConsumeToken(); // consume ','
}
- if (Tok.isNot(tok::semi)) {
- Diag(Tok, diag::err_expected_semi_after) << "@dynamic";
- SkipUntil(tok::semi);
- }
- else
- ConsumeToken(); // consume ';'
+ ExpectAndConsume(tok::semi, diag::err_expected_semi_after, "@dynamic");
return 0;
}
// RUN: %clang_cc1 -fsyntax-only -verify %s
@interface MyClass {
-
+ int prop;
};
@property unsigned char bufferedUTF8Bytes[4]; // expected-error {{property cannot have array or function type}}
@property unsigned char bufferedUTFBytes:1; // expected-error {{property name cannot be a bitfield}}
@property(nonatomic, retain, setter=ab_setDefaultToolbarItems) MyClass *ab_defaultToolbarItems; // expected-error {{method name referenced in property setter attribute must end with ':'}}
+
+@property int prop;
@end
@implementation MyClass
-@dynamic ab_defaultToolbarItems;
+@dynamic ab_defaultToolbarItems // expected-error{{expected ';' after @dynamic}}
+@synthesize prop // expected-error{{expected ';' after @synthesize}}
@end
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s
// FIXME: This is a horrible error message here. Fix.
int @"s" = 5; // expected-error {{prefix attribute must be}}
// rdar://6480479
@interface A
-}; // expected-error {{missing @end}} expected-error {{expected external declaration}}
+}; // expected-error {{missing @end}} \
+// expected-error {{expected external declaration}} \
+// expected-warning{{extra ';' outside of a function}}
[(super) a]; // expected-error {{use of undeclared identifier 'super'}}
}
@end
+
+@compatibility_alias A3 A2;