summaryrefslogtreecommitdiff
path: root/clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.grammar/p6.cpp
blob: f9702ba7ccb023f22765bae87b259e435bbc24b7 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// RUN: %clang_cc1 -std=c++11 -verify %s

namespace std_example {

int p[10];
void f() {
  int x = 42, y[5];
  // FIXME: Produce a better diagnostic for this case.
  int(p[[x] { return x; }()]); // expected-error {{expected ']'}}
  y[[] { return 2; }()] = 2; // expected-error {{consecutive left square brackets}}
}

}