]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/20_util/function/cons/deduction_c++23.cc
libstdc++: Remove dg-options "-std=gnu++23" from remaining tests
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 20_util / function / cons / deduction_c++23.cc
CommitLineData
614e5696 1// { dg-do compile { target c++23 } }
7cc9022f 2// { dg-require-effective-target hosted }
614e5696
JW
3
4#include <functional>
5
6template<typename T, typename U> struct require_same;
7template<typename T> struct require_same<T, T> { using type = void; };
8
9template<typename T, typename U>
10 typename require_same<T, U>::type
11 check_type(U&) { }
12
13void
14test_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}