reject explicit pointer arithmetic on interface pointers in 64-bit objc ABI
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70004 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaObjC/sizeof-interface.m b/test/SemaObjC/sizeof-interface.m
index a1d722b..75d7daa 100644
--- a/test/SemaObjC/sizeof-interface.m
+++ b/test/SemaObjC/sizeof-interface.m
@@ -7,6 +7,8 @@
// 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 @@
// 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}}
}