"@end must appear in an @implementation context">;
def error_property_ivar_decl : Error<
"property synthesize requires specification of an ivar">;
+def warn_semicolon_before_method_nody : Warning<
+ "semicolon at start of method definition is ignored">,
+ InGroup<DiagGroup<"semicolon-at-method-body">>;
def err_expected_field_designator : Error<
"expected a field designator, such as '.field = 4'">;
"parsing Objective-C method");
// parse optional ';'
- if (Tok.is(tok::semi))
+ if (Tok.is(tok::semi)) {
+ if (ObjCImpDecl)
+ Diag(Tok, diag::warn_semicolon_before_method_nody);
ConsumeToken();
+ }
// We should have an opening brace now.
if (Tok.isNot(tok::l_brace)) {
@end
@implementation Subclass
-- (NSString *)token;
+- (NSString *)token; // expected-warning {{semicolon at start of method definition is ignored}}
{
NSMutableString *result = nil;
@end
@implementation XCRefactoringTransformation
-- (NSDictionary *)setUpInfoForTransformKey:(NSString *)transformKey outError:(NSError **)outError; {
+- (NSDictionary *)setUpInfoForTransformKey:(NSString *)transformKey outError:(NSError **)outError {
@try {}
// the exception name is optional (weird)
@catch (NSException *) {}