gcc/testsuite/g++.dg/cpp1y/vla8.C
raw| 1 | // PR c++/55149 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | // { dg-options "-Wno-vla" } |
| 4 | |
| 5 | template<unsigned int TA> |
| 6 | struct SA |
| 7 | { |
| 8 | SA (const int & PA); |
| 9 | int nt; |
| 10 | }; |
| 11 | |
| 12 | template<typename TB> |
| 13 | inline void |
| 14 | test(TB aa) |
| 15 | { |
| 16 | ; |
| 17 | } |
| 18 | |
| 19 | template<unsigned int TA> |
| 20 | inline |
| 21 | SA<TA>::SA(const int & PA) |
| 22 | { |
| 23 | float e[nt]; |
| 24 | test([&e](int i, int j){ return e[i] < e[j]; }); |
| 25 | } |
| 26 | |
| 27 | int main() |
| 28 | { |
| 29 | int d; |
| 30 | SA<2> iso(d); |
| 31 | return 0; |
| 32 | } |