summaryrefslogtreecommitdiffstats
path: root/test/SemaObjC/ivar-lookup.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjC/ivar-lookup.m')
-rw-r--r--test/SemaObjC/ivar-lookup.m37
1 files changed, 35 insertions, 2 deletions
diff --git a/test/SemaObjC/ivar-lookup.m b/test/SemaObjC/ivar-lookup.m
index 2b14bff..df9d8ba 100644
--- a/test/SemaObjC/ivar-lookup.m
+++ b/test/SemaObjC/ivar-lookup.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -fsyntax-only -verify
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
@interface Test {
int x;
@@ -29,7 +29,7 @@ extern struct foo x;
@implementation A
- (int*)method {
- int *ip = [Ivar method]; // expected-warning{{warning: incompatible pointer types initializing 'int *' with an expression of type 'float *'}}
+ int *ip = [Ivar method]; // expected-warning{{incompatible pointer types initializing 'int *' with an expression of type 'float *'}}
// Note that there is no warning in Objective-C++
return 0;
}
@@ -47,3 +47,36 @@ extern struct foo x;
// expected-error{{instance variable 'b' accessed in class method}}
}
@end
+
+// rdar://10309454
+@interface Radar10309454
+{
+ int IVAR; // expected-note 4 {{previous definition is here}}
+}
+@end
+
+@interface Radar10309454()
+{
+ int IVAR; // expected-error {{instance variable is already declared}}
+ int PIVAR; // expected-note {{previous definition is here}}
+}
+@end
+
+@interface Radar10309454()
+{
+ int IVAR; // expected-error {{instance variable is already declared}}
+}
+@end
+
+@interface Radar10309454()
+{
+ int IVAR; // expected-error {{instance variable is already declared}}
+ int PIVAR; // expected-error {{instance variable is already declared}}
+}
+@end
+
+@implementation Radar10309454
+{
+ int IVAR; // expected-error {{instance variable is already declared}}
+}
+@end
OpenPOWER on IntegriCloud