summaryrefslogtreecommitdiffstats
path: root/test/SemaObjC/ivar-in-implementations.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjC/ivar-in-implementations.m')
-rw-r--r--test/SemaObjC/ivar-in-implementations.m22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/SemaObjC/ivar-in-implementations.m b/test/SemaObjC/ivar-in-implementations.m
new file mode 100644
index 0000000..32d3c35
--- /dev/null
+++ b/test/SemaObjC/ivar-in-implementations.m
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -fsyntax-only -fobjc-nonfragile-abi2 -verify %s
+
+@interface Super @end
+
+@interface INTFSTANDALONE : Super
+{
+ id IVAR; // expected-note {{previous definition is here}}
+}
+
+@end
+
+@implementation INTFSTANDALONE : Super // expected-warning {{class implementation may not have super class}}
+{
+@private
+ id IVAR1;
+@protected
+ id IVAR2; // expected-error {{only private ivars may be declared in implementation}}
+@private
+ id IVAR3;
+ int IVAR; // expected-error {{instance variable is already declared}}
+}
+@end
OpenPOWER on IntegriCloud