[cfe-commits] r172545 - /cfe/trunk/test/Parser/warn-semicolon-before-method-body.m

Dmitri Gribenko gribozavr at gmail.com
Tue Jan 15 10:29:04 PST 2013


Author: gribozavr
Date: Tue Jan 15 12:29:04 2013
New Revision: 172545

URL: http://llvm.org/viewvc/llvm-project?rev=172545&view=rev
Log:
Add a test for -Wsemicolon-before-method-body fixit

Added:
    cfe/trunk/test/Parser/warn-semicolon-before-method-body.m

Added: cfe/trunk/test/Parser/warn-semicolon-before-method-body.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/warn-semicolon-before-method-body.m?rev=172545&view=auto
==============================================================================
--- cfe/trunk/test/Parser/warn-semicolon-before-method-body.m (added)
+++ cfe/trunk/test/Parser/warn-semicolon-before-method-body.m Tue Jan 15 12:29:04 2013
@@ -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.
+
+ at interface NSObject
+ at end
+
+ at interface C : NSObject
+- (int)z;
+ at end
+
+ at implementation C
+- (int)z; // expected-warning {{semicolon before method body is ignored}}
+{
+  return 0;
+}
+ at end
+
+// CHECK: fix-it:"{{.*}}":{15:9-15:10}:""
+





More information about the cfe-commits mailing list