p6.cpp revision 6880f492365cc4fa4c941aa83688635003ee7498
1// RUN: %clang_cc1 -std=c++11 -verify %s
2
3namespace std_example {
4
5int p[10];
6void f() {
7  int x = 42, y[5];
8  // FIXME: Produce a better diagnostic for this case.
9  int(p[[x] { return x; }()]); // expected-error {{expected ']'}} \
10  // expected-warning {{unknown attribute 'x' ignored}}
11  y[[] { return 2; }()] = 2; // expected-error {{consecutive left square brackets}}
12}
13
14}
15