// PR c++/64227 // { dg-do compile { target c++14 } } template struct remove_reference { typedef T type; }; template struct remove_reference { typedef T type; }; template struct remove_reference { typedef T type; }; template constexpr T&& forward(typename remove_reference::type& t) noexcept { return static_cast(t); } template constexpr T&& forward(typename remove_reference::type&& t) noexcept { return static_cast(t); } template auto greater_than(T&& t) { return [val = forward(t)] (const auto& arg) { return arg > val; }; } template void g(Functor f) { for (int i = 0; i < 100000; i++) f(i); } int main() { g(greater_than(10)); }