diff options
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}} +} |

