diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-07-16 17:59:14 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-07-16 17:59:14 +0000 |
commit | ca75db7c02c7c452cde8c8f56c898dff1c1b3e95 (patch) | |
tree | c15d41be3581e6052bffbb34c9e67dfb0c7641f0 /clang/test/SemaObjC/sizeof-interface.m | |
parent | dd27e5e10a88ab6db82d553109a65a0cb4f7e54b (diff) | |
download | bcm5719-llvm-ca75db7c02c7c452cde8c8f56c898dff1c1b3e95.tar.gz bcm5719-llvm-ca75db7c02c7c452cde8c8f56c898dff1c1b3e95.zip |
Diagnose ++/-- op on objc pointers in
nonfragile abi, instead of crashing.
llvm-svn: 76088
Diffstat (limited to 'clang/test/SemaObjC/sizeof-interface.m')
-rw-r--r-- | clang/test/SemaObjC/sizeof-interface.m | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/sizeof-interface.m b/clang/test/SemaObjC/sizeof-interface.m index 75d7daafbbc..140a980311e 100644 --- a/clang/test/SemaObjC/sizeof-interface.m +++ b/clang/test/SemaObjC/sizeof-interface.m @@ -77,3 +77,14 @@ int bar(I0 *P) { } @end + +@interface Foo @end + +int foo() +{ + Foo *f; + + // Both of these crash clang nicely + ++f; // expected-error {{arithmetic on pointer to interface 'Foo', which is not a constant size in non-fragile ABI}} + --f; // expected-error {{arithmetic on pointer to interface 'Foo', which is not a constant size in non-fragile ABI}} +} |