Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp0x/gen-attrs-47.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // { dg-do compile { target c++11 } } |
2 // Example taken from dcl.attr.grammar: | |
3 | |
4 int p[10]; | |
5 void f() | |
6 { | |
7 int x = 42, y[5]; | |
8 /* Here, the '[[' should have introduced an attribute, on a | |
9 lambda invocation an array subscripting expression. */ | |
10 int(p[[x] { return x; }()]); // { dg-error "expected|consecutive" } | |
11 /* Likewise, the '[[gnu::' is invalid here. */ | |
12 y[[] { return 2; }()] = 2; // { dg-error "expected|consecutive" } | |
13 } |