aboutsummaryrefslogtreecommitdiff
path: root/test/SemaObjC/invalid-objc-decls-1.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjC/invalid-objc-decls-1.m')
-rw-r--r--test/SemaObjC/invalid-objc-decls-1.m29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/SemaObjC/invalid-objc-decls-1.m b/test/SemaObjC/invalid-objc-decls-1.m
new file mode 100644
index 0000000000..fa18079d07
--- /dev/null
+++ b/test/SemaObjC/invalid-objc-decls-1.m
@@ -0,0 +1,29 @@
+// RUN: clang -fsyntax-only -verify %s
+
+@interface Super @end
+Super s1; // expected-error{{statically allocated Objective-C object 's1'}}
+
+extern Super e1; // expected-error{{statically allocated Objective-C object 'e1'}}
+
+struct S {
+ Super s1; // expected-error{{statically allocated Objective-C object 's1'}}
+};
+
+@protocol P1 @end
+
+@interface INTF
+{
+ Super ivar1; // expected-error{{statically allocated Objective-C object 'ivar1'}}
+}
+@end
+
+@interface MyIntf
+{
+ Super<P1> ivar1; // expected-error{{statically allocated Objective-C object 'ivar1'}}
+}
+@end
+
+Super foo(Super parm1) {
+ Super p1; // expected-error{{statically allocated Objective-C object 'p1'}}
+ return p1;
+}