diff options
Diffstat (limited to 'test/SemaObjCXX/vla.mm')
-rw-r--r-- | test/SemaObjCXX/vla.mm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/SemaObjCXX/vla.mm b/test/SemaObjCXX/vla.mm new file mode 100644 index 000000000000..9c6fc54f817a --- /dev/null +++ b/test/SemaObjCXX/vla.mm @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +@interface Data +- (unsigned)length; +- (void)getData:(void*)buffer; +@end + +void test(Data *d) { + char buffer[[d length]]; // expected-error{{variable length arrays are not permitted in C++}} + [d getData:buffer]; +} + |