(root)/
gcc-13.2.0/
libstdc++-v3/
testsuite/
20_util/
function_objects/
invoke/
dangling_ref.cc
// { dg-options "-std=gnu++23" }
// { dg-do compile { target c++23 } }
#include <functional>

int f();

template<typename R>
concept can_invoke = requires (int (&f)()) { std::invoke_r<R>(f); };

static_assert( not can_invoke<const int&> );
static_assert( not can_invoke<int&&> );
static_assert( not can_invoke<const long&> );