/cp
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / pr66735.C
blob2d81fb880ef2760cf1fc8ec2fe8bc9f202e6481f
1 // { dg-do compile { target c++14 } }
3 // PR c++/66735, lost constness on reference capture
5 template <typename T> void Foo ()
7   T const x = 5;
9   auto l = [&rx = x]() {};
11   l ();
14 void Baz ()
16   int const x = 5;
17   auto l = [&rx = x]() {};
20   l ();
21   Foo<int> ();