aboutsummaryrefslogtreecommitdiff
path: root/test/SemaObjC/sizeof-interface.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjC/sizeof-interface.m')
-rw-r--r--test/SemaObjC/sizeof-interface.m6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/SemaObjC/sizeof-interface.m b/test/SemaObjC/sizeof-interface.m
index a1d722b742..75d7daafbb 100644
--- a/test/SemaObjC/sizeof-interface.m
+++ b/test/SemaObjC/sizeof-interface.m
@@ -7,6 +7,8 @@ int g0 = sizeof(I0); // expected-error{{invalid application of 'sizeof' to an in
// rdar://6821047
void *g3(I0 *P) {
+ P = P+5; // expected-error {{arithmetic on pointer to incomplete type 'I0 *'}}
+
return &P[4]; // expected-error{{subscript of pointer to incomplete type 'I0'}}
}
@@ -49,6 +51,10 @@ typedef struct { @defs(I1) } I1_defs; // expected-error {{invalid application of
// rdar://6821047
int bar(I0 *P) {
+ P = P+5; // expected-error {{arithmetic on pointer to interface 'I0', which is not a constant size in non-fragile ABI}}
+ P = 5+P; // expected-error {{arithmetic on pointer to interface 'I0', which is not a constant size in non-fragile ABI}}
+ P = P-5; // expected-error {{arithmetic on pointer to interface 'I0', which is not a constant size in non-fragile ABI}}
+
return P[4].x[2]; // expected-error {{subscript requires size of interface 'I0', which is not constant in non-fragile ABI}}
}