diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-01-08 23:17:51 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-01-08 23:17:51 +0000 |
commit | 9c0816f36d9012c5ed1445ed969fba5b60bcec01 (patch) | |
tree | 4eba9b6f0fbcc4f27f7ac237d44cd23d3489df50 /test | |
parent | 6a502c4430088fe3bac7b5886cd9425f7e306b63 (diff) |
objectiveC blocks: It is impractical to capture
struct variables with flexiable array members in
blocks (and lambdas). Issue error instead of
crashing in IRGen. // rdar://12655829
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171912 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/SemaObjCXX/capturing-flexible-array-in-block.mm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/SemaObjCXX/capturing-flexible-array-in-block.mm b/test/SemaObjCXX/capturing-flexible-array-in-block.mm new file mode 100644 index 0000000000..4899c4653a --- /dev/null +++ b/test/SemaObjCXX/capturing-flexible-array-in-block.mm @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -fsyntax-only -fblocks -verify -std=c++11 %s +// rdar://12655829 + +void f() { + struct { int x; int y[]; } a; // expected-note 2 {{'a' declared here}} + ^{return a.x;}(); // expected-error {{cannot refer to declaration of structure variable with flexible array member inside block}} + + [] {return a.x;}(); // expected-error {{variable 'a' with flexible array member cannot be captured in a lambda expression}} +} |