/cp
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / pr77786.C
blobe242228335cb28af225423ce814fe4784e04a77b
1 // PR c++/77786
2 // { dg-do compile { target c++14 } }
4 #include <vector>
6 template<int N>
7 void
8 foo (std::vector<int> a)
10   auto const a_size = a.size();
11   auto bar = [&](auto y) -> void { int a_size_2 = a_size; };
12   double x = 0.0;
13   bar (x);
16 int
17 main ()
19   std::vector<int> a(1);
20   foo<1>(a);