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