summaryrefslogtreecommitdiff
path: root/clang/test/SemaObjCXX/objc-extern-c.mm
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaObjCXX/objc-extern-c.mm')
-rw-r--r--clang/test/SemaObjCXX/objc-extern-c.mm30
1 files changed, 30 insertions, 0 deletions
diff --git a/clang/test/SemaObjCXX/objc-extern-c.mm b/clang/test/SemaObjCXX/objc-extern-c.mm
new file mode 100644
index 0000000..6bd3761
--- /dev/null
+++ b/clang/test/SemaObjCXX/objc-extern-c.mm
@@ -0,0 +1,30 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+@protocol P // expected-note {{previous}}
+-(void)meth1;
+@end
+
+@interface I // expected-note {{previous}}
+@end
+
+@interface I2
+@end
+@interface I2(C) // expected-note {{previous}}
+@end
+
+extern "C" {
+@protocol P // expected-warning {{duplicate protocol definition of 'P' is ignored}}
+-(void)meth2;
+@end
+
+@interface I // expected-error {{duplicate}}
+@end
+
+@interface I2(C) // expected-warning {{duplicate}}
+@end
+}
+
+void test(id<P> p) {
+ [p meth1];
+ [p meth2]; // expected-warning {{not found}}
+}