@@ -25,7 +25,10 @@ template<cpp2::fn_t<cpp2::fn_t<void()>*()>* V> auto g() -> void;
25
25
26
26
// In non-local function return type.
27
27
[[nodiscard]] auto g1 () -> cpp2::fn_t<void()>*;
28
- template <bool V> [[nodiscard]] auto g1 () -> cpp2::fn_t<void()>*;
28
+ template <bool V> [[nodiscard]] auto g1 () -> cpp2::fn_t<void()>*
29
+ CPP2_REQUIRES (V)
30
+ #line 90 "pure2-function-type-id.cpp2"
31
+ ;
29
32
[[nodiscard]] auto g2 () -> cpp2::fn_t<cpp2::fn_t<void()>*()>*;
30
33
31
34
// clang-format off
@@ -71,14 +74,14 @@ auto main() -> int{
71
74
static_assert ((std::is_const_v<decltype (f11)>)==std::is_const_v<decltype (i1)>);
72
75
static_assert ((std::is_const_v<decltype (f12)>)==std::is_const_v<decltype (i2)>);
73
76
static_assert ((std::is_const_v<decltype (f13)>)==std::is_const_v<decltype (i3)>);
74
- ( void ) std::move (f10);
75
- ( void ) std::move (f11);
76
- ( void ) std::move (f12);
77
- ( void ) std::move (f13);
78
- ( void ) std::move (i0);
79
- ( void ) std::move (i1);
80
- ( void ) std::move (i2);
81
- ( void ) std::move (i3);
77
+ static_cast < void >( std::move (f10) );
78
+ static_cast < void >( std::move (f11) );
79
+ static_cast < void >( std::move (f12) );
80
+ static_cast < void >( std::move (f13) );
81
+ static_cast < void >( std::move (i0) );
82
+ static_cast < void >( std::move (i1) );
83
+ static_cast < void >( std::move (i2) );
84
+ static_cast < void >( std::move (i3) );
82
85
83
86
// Variables with various kinds of parameter.
84
87
cpp2::fn_t <void (cpp2::in<cpp2::i32>)>* f5 {[](cpp2::in<cpp2::i32> x) -> void {}};
@@ -112,21 +115,21 @@ cpp2::in<cpp2::fn_t<void()>> f = *cpp2::assert_not_null(f0);
112
115
113
116
// As local function parameter.
114
117
#line 62 "pure2-function-type-id.cpp2"
115
- ( void ) [](cpp2::in<cpp2::fn_t <void ()>> f) -> void {};
116
- ( void ) [](cpp2::fn_t <void ()>* f) -> void {};
117
- ( void ) [](cpp2::fn_t <cpp2::fn_t <void ()>*()>* f) -> void {};
118
- ( void ) [](cpp2::fn_t <cpp2::fn_t <cpp2::fn_t <void ()>*()>*()>* f) -> void {};
118
+ static_cast < void >( [](cpp2::in<cpp2::fn_t <void ()>> f) -> void {}) ;
119
+ static_cast < void >( [](cpp2::fn_t <void ()>* f) -> void {}) ;
120
+ static_cast < void >( [](cpp2::fn_t <cpp2::fn_t <void ()>*()>* f) -> void {}) ;
121
+ static_cast < void >( [](cpp2::fn_t <cpp2::fn_t <cpp2::fn_t <void ()>*()>*()>* f) -> void {}) ;
119
122
120
123
// In local function return type.
121
- ( void ) [_0 = f0]() -> cpp2::fn_t <void ()>& { return *cpp2::assert_not_null (_0); };
122
- ( void ) []() -> cpp2::fn_t <void ()>* { return nullptr ; };
123
- ( void ) []() -> cpp2::fn_t <cpp2::fn_t <void ()>*()>* { return nullptr ; };
124
+ static_cast < void >( [_0 = f0]() -> cpp2::fn_t <void ()>& { return *cpp2::assert_not_null (_0); }) ;
125
+ static_cast < void >( []() -> cpp2::fn_t <void ()>* { return nullptr ; }) ;
126
+ static_cast < void >( []() -> cpp2::fn_t <cpp2::fn_t <void ()>*()>* { return nullptr ; }) ;
124
127
125
128
// With `!throws`.
126
- ( void ) std::type_identity_t <cpp2::fn_t <void (std::string_view, CPP2_MESSAGE_PARAM) noexcept >*>{cpp2::report_and_terminate};
129
+ static_cast < void >( std::type_identity_t <cpp2::fn_t <void (std::string_view, CPP2_MESSAGE_PARAM) noexcept >*>{cpp2::report_and_terminate}) ;
127
130
128
131
// As template argument.
129
- ( void ) std::type_identity_t <cpp2::fn_t <void ()>*>{std::move (f0)};
132
+ static_cast < void >( std::type_identity_t <cpp2::fn_t <void ()>*>{std::move (f0)}) ;
130
133
static_assert (std::is_function_v<cpp2::fn_t <void ()>>);
131
134
}
132
135
0 commit comments