blob: 856e0b845b83fa29aaf7389778f23ba1fd1268b6 [file] [log] [blame]
// { dg-options "-std=gnu++23" }
// { dg-do compile { target c++23 } }
// { dg-require-effective-target hosted }
#include <functional>
template<typename T, typename U> struct require_same;
template<typename T> struct require_same<T, T> { using type = void; };
template<typename T, typename U>
typename require_same<T, U>::type
check_type(U&) { }
void
test_static_call_operator()
{
struct F1 { static long operator()() { return 0; } };
std::function func1 = F1{};
check_type<std::function<long()>>(func1);
struct F2 { static float operator()(char, void*) noexcept { return 0; } };
std::function func2 = F2{};
check_type<std::function<float(char, void*)>>(func2);
}