Debian Codegraph @

gcc/testsuite/g++.dg/cpp1y/pr77786.C

raw
1 // PR c++/77786
2 // { dg-do compile { target c++14 } }
3 // { dg-skip-if "requires hosted libstdc++ for vector" { ! hostedlib } }
4
5 #include <vector>
6
7 template<int N>
8 void
9 foo (std::vector<int> a)
10 {
11 auto const a_size = a.size();
12 auto bar = [&](auto y) -> void { int a_size_2 = a_size; };
13 double x = 0.0;
14 bar (x);
15 }
16
17 int
18 main ()
19 {
20 std::vector<int> a(1);
21 foo<1>(a);
22 }