view gcc/testsuite/g++.dg/cpp1y/pr81574.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
line wrap: on
line source

// { dg-do compile { target c++14 } }
// PR c++/81574 references to functions are captured by reference.

// 8.1.5.2/10
// For each entity captured by copy, ... an lvalue reference to the
// referenced function type if the entity is a reference to a function

void f (void (&b)())
{
  [=] {  b; } ();
  [=, b(f)] { b; } ();
  [=, b(b)] { b; } ();
}