Debian Codegraph @

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

raw
1 // { dg-do compile { target c++14 } }
2 // PR c++/81574 references to functions are captured by reference.
3
4 // 8.1.5.2/10
5 // For each entity captured by copy, ... an lvalue reference to the
6 // referenced function type if the entity is a reference to a function
7
8 void f (void (&b)())
9 {
10 [=] { b; } ();
11 [=, b(f)] { b; } ();
12 [=, b(b)] { b; } ();
13 }