diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2013-01-15 18:29:04 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2013-01-15 18:29:04 +0000 |
commit | 29360247c5187966fb78cc803ad97295eb16e64d (patch) | |
tree | 6883648c8cb4558b2209dadb2f23049454f9bc05 /clang/test/Parser | |
parent | d33ce6f100003ea4bf57af9b7585248576e23edb (diff) | |
download | bcm5719-llvm-29360247c5187966fb78cc803ad97295eb16e64d.tar.gz bcm5719-llvm-29360247c5187966fb78cc803ad97295eb16e64d.zip |
Add a test for -Wsemicolon-before-method-body fixit
llvm-svn: 172545
Diffstat (limited to 'clang/test/Parser')
-rw-r--r-- | clang/test/Parser/warn-semicolon-before-method-body.m | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/clang/test/Parser/warn-semicolon-before-method-body.m b/clang/test/Parser/warn-semicolon-before-method-body.m new file mode 100644 index 00000000000..be408ebd311 --- /dev/null +++ b/clang/test/Parser/warn-semicolon-before-method-body.m @@ -0,0 +1,22 @@ +// RUN: %clang_cc1 -fsyntax-only -Wsemicolon-before-method-body -verify %s +// RUN: %clang_cc1 -fsyntax-only -Wsemicolon-before-method-body -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s + +// Allow optional semicolon in objc method definiton after method prototype, +// warn about it and suggest a fixit. + +@interface NSObject +@end + +@interface C : NSObject +- (int)z; +@end + +@implementation C +- (int)z; // expected-warning {{semicolon before method body is ignored}} +{ + return 0; +} +@end + +// CHECK: fix-it:"{{.*}}":{15:9-15:10}:"" + |