]>
Commit | Line | Data |
---|---|---|
614e5696 | 1 | // { dg-do compile { target c++23 } } |
7cc9022f | 2 | // { dg-require-effective-target hosted } |
614e5696 JW |
3 | |
4 | #include <functional> | |
5 | ||
6 | template<typename T, typename U> struct require_same; | |
7 | template<typename T> struct require_same<T, T> { using type = void; }; | |
8 | ||
9 | template<typename T, typename U> | |
10 | typename require_same<T, U>::type | |
11 | check_type(U&) { } | |
12 | ||
13 | void | |
14 | test_static_call_operator() | |
15 | { | |
16 | struct F1 { static long operator()() { return 0; } }; | |
17 | std::function func1 = F1{}; | |
18 | check_type<std::function<long()>>(func1); | |
19 | ||
20 | struct F2 { static float operator()(char, void*) noexcept { return 0; } }; | |
21 | std::function func2 = F2{}; | |
22 | check_type<std::function<float(char, void*)>>(func2); | |
23 | } |