xref: /minix3/external/bsd/llvm/dist/clang/test/Parser/warn-semicolon-before-method-body.m (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -Wsemicolon-before-method-body -verify %s
2f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -Wsemicolon-before-method-body -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
3f4a2713aSLionel Sambuc
4*0a6a1f1dSLionel Sambuc// Allow optional semicolon in objc method definition after method prototype,
5f4a2713aSLionel Sambuc// warn about it and suggest a fixit.
6f4a2713aSLionel Sambuc
7f4a2713aSLionel Sambuc@interface NSObject
8f4a2713aSLionel Sambuc@end
9f4a2713aSLionel Sambuc
10f4a2713aSLionel Sambuc@interface C : NSObject
11f4a2713aSLionel Sambuc- (int)z;
12f4a2713aSLionel Sambuc@end
13f4a2713aSLionel Sambuc
14f4a2713aSLionel Sambuc@implementation C
15f4a2713aSLionel Sambuc- (int)z; // expected-warning {{semicolon before method body is ignored}}
16f4a2713aSLionel Sambuc{
17f4a2713aSLionel Sambuc  return 0;
18f4a2713aSLionel Sambuc}
19f4a2713aSLionel Sambuc@end
20f4a2713aSLionel Sambuc
21f4a2713aSLionel Sambuc// CHECK: fix-it:"{{.*}}":{15:9-15:10}:""
22f4a2713aSLionel Sambuc
23