Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const11a.C

raw
1 // PR c++/108975
2 // A version of lambda-const11.C using a generic lambda.
3 // { dg-do compile { target c++14 } }
4
5 template<int> void g();
6 template<int> struct A { };
7
8 template<class T>
9 void f() {
10 constexpr int dim = 1;
11 auto l = [&](auto) {
12 int n[dim * 1];
13 using ty1 = decltype(g<dim * 2>());
14 using ty2 = A<dim * 3>;
15 };
16 l(0);
17 // In f<int>, we shouldn't actually capture dim.
18 static_assert (sizeof(l) == 1, "");
19 }
20
21 template void f<int>();