aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-47.C
blob: af74abd1862230fd530a8bc2cbcf49de3e060e9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// { dg-do compile { target c++11 } }
// Example taken from dcl.attr.grammar:

int p[10];
void f()
{
    int x = 42, y[5];
    /* Here, the '[[' should have introduced an attribute, on a
       lambda invocation an array subscripting expression.  */
    int(p[[x] { return x; }()]); // { dg-error "expected|consecutive" }
    /* Likewise, the '[[gnu::' is invalid here.  */
    y[[] { return 2; }()] = 2; // { dg-error "expected|consecutive" }
}