1 // { dg-do compile { target c++11 } }
3 #define SA(X) static_assert((X),#X)
5 using func_type = void(*)();
6 SA( ! __is_nothrow_invocable(func_type) );
8 #if __cpp_noexcept_function_type
9 using func_type_nt = void(*)() noexcept;
10 SA( __is_nothrow_invocable(func_type_nt) );
14 using mem_type = int X::*;
16 SA( ! __is_nothrow_invocable(mem_type) );
17 SA( ! __is_nothrow_invocable(mem_type, int) );
18 SA( ! __is_nothrow_invocable(mem_type, int&) );
19 SA( __is_nothrow_invocable(mem_type, X&) );
21 using memfun_type = int (X::*)();
23 SA( ! __is_nothrow_invocable(memfun_type) );
24 SA( ! __is_nothrow_invocable(memfun_type, int) );
25 SA( ! __is_nothrow_invocable(memfun_type, int&) );
26 SA( ! __is_nothrow_invocable(memfun_type, X&) );
27 SA( ! __is_nothrow_invocable(memfun_type, X*) );
29 #if __cpp_noexcept_function_type
30 using memfun_type_nt = int (X::*)() noexcept;
32 SA( ! __is_nothrow_invocable(memfun_type_nt) );
33 SA( ! __is_nothrow_invocable(memfun_type_nt, int) );
34 SA( ! __is_nothrow_invocable(memfun_type_nt, int&) );
35 SA( __is_nothrow_invocable(memfun_type_nt, X&) );
36 SA( __is_nothrow_invocable(memfun_type_nt, X*) );
41 long& operator()() const noexcept;
42 short& operator()(int) &&;
43 char& operator()(int) const& noexcept;
45 void operator()(int, int) noexcept;
49 SA( ! __is_nothrow_invocable(F ) );
50 SA( __is_nothrow_invocable(CF) );
52 SA( ! __is_nothrow_invocable(F, int) );
53 SA( __is_nothrow_invocable(F&, int) );
55 SA( __is_nothrow_invocable(CF, int) );
56 SA( __is_nothrow_invocable(CF&, int) );
57 SA( ! __is_nothrow_invocable(F, int, int) );
60 X operator()() const noexcept { return {}; }
62 SA( __is_nothrow_invocable(FX) );