Fariborz Jahanian | e178e70 | 2013-01-09 00:09:15 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -fblocks -verify -std=c++11 %s |
Fariborz Jahanian | 9c0816f | 2013-01-08 23:17:51 +0000 | [diff] [blame] | 2 | // rdar://12655829 |
| 3 | |
| 4 | void f() { |
Fariborz Jahanian | e178e70 | 2013-01-09 00:09:15 +0000 | [diff] [blame] | 5 | struct { int x; int y[]; } a; // expected-note 2 {{'a' declared here}} |
Fariborz Jahanian | 9c0816f | 2013-01-08 23:17:51 +0000 | [diff] [blame] | 6 | ^{return a.x;}(); // expected-error {{cannot refer to declaration of structure variable with flexible array member inside block}} |
Fariborz Jahanian | e178e70 | 2013-01-09 00:09:15 +0000 | [diff] [blame] | 7 | [] {return a.x;}(); // expected-error {{variable 'a' with flexible array member cannot be captured in a lambda expression}} |
Fariborz Jahanian | 9c0816f | 2013-01-08 23:17:51 +0000 | [diff] [blame] | 8 | } |