summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC/no-protocol-option-tests.m
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-03-31 18:23:33 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-03-31 18:23:33 +0000
commitc1fb862fda6091abdce88ad334ebd55021b8b203 (patch)
tree43d4eabdd5c3c10cc81b8d20d96c90ce350e7f74 /clang/test/SemaObjC/no-protocol-option-tests.m
parentd7d70e4788a94272908700d4b807631037e3168e (diff)
downloadbcm5719-llvm-c1fb862fda6091abdce88ad334ebd55021b8b203.tar.gz
bcm5719-llvm-c1fb862fda6091abdce88ad334ebd55021b8b203.zip
Patch implements gcc's -Wno-protocol option to suppress warning
on unimplemented methods in protocols adopted by a class. (radar 7056600). llvm-svn: 100028
Diffstat (limited to 'clang/test/SemaObjC/no-protocol-option-tests.m')
-rw-r--r--clang/test/SemaObjC/no-protocol-option-tests.m32
1 files changed, 32 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/no-protocol-option-tests.m b/clang/test/SemaObjC/no-protocol-option-tests.m
new file mode 100644
index 00000000000..5d2da0af48e
--- /dev/null
+++ b/clang/test/SemaObjC/no-protocol-option-tests.m
@@ -0,0 +1,32 @@
+// RUN: %clang_cc1 -fsyntax-only -Wno-protocol -verify %s
+// rdar: // 7056600
+
+@protocol P
+- PMeth;
+@end
+
+// Test1
+@interface I <P> @end
+@implementation I @end // no warning with -Wno-protocol
+
+// Test2
+@interface C -PMeth; @end
+@interface C (Category) <P> @end
+@implementation C (Category) @end // no warning with -Wno-protocol
+
+// Test2
+@interface super - PMeth; @end
+@interface J : super <P>
+- PMeth; // expected-note {{ method definition for 'PMeth' not found}}
+@end
+@implementation J @end // expected-warning {{incomplete implementation}}
+
+// Test3
+@interface K : super <P>
+@end
+@implementation K @end // no warning with -Wno-protocol
+
+// Test4
+@interface Root @end
+@interface L : Root<P> @end
+@implementation L @end // no warning with -Wno-protocol
OpenPOWER on IntegriCloud