blob: d7d888564c1e3bd4f5dc1cc12415a3696bcd5039 [file] [log] [blame]
Fariborz Jahaniane178e702013-01-09 00:09:15 +00001// RUN: %clang_cc1 -fsyntax-only -fblocks -verify -std=c++11 %s
Fariborz Jahanian9c0816f2013-01-08 23:17:51 +00002// rdar://12655829
3
4void f() {
Fariborz Jahaniane178e702013-01-09 00:09:15 +00005 struct { int x; int y[]; } a; // expected-note 2 {{'a' declared here}}
Fariborz Jahanian9c0816f2013-01-08 23:17:51 +00006 ^{return a.x;}(); // expected-error {{cannot refer to declaration of structure variable with flexible array member inside block}}
Fariborz Jahaniane178e702013-01-09 00:09:15 +00007 [] {return a.x;}(); // expected-error {{variable 'a' with flexible array member cannot be captured in a lambda expression}}
Fariborz Jahanian9c0816f2013-01-08 23:17:51 +00008}