Skip to content

Commit d773392

Browse files
committed
Fix callable
1 parent 80cb5c1 commit d773392

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

tests/std/tests/P2300R2_executors_tag_invoke/test.compile.pass.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,26 @@ namespace callable {
103103
static_assert(_Callable<decltype([](int) {}), long>);
104104
static_assert(_Callable<decltype([](conversion_target) {}), with_conversion>);
105105
static_assert(!_Callable<decltype([](conversion_target) {}), with_explicit_conversion>);
106+
107+
// Check nothrow
108+
static_assert(!_Nothrow_callable<void (*)()>);
109+
static_assert(!_Nothrow_callable<void (*)(), int>);
110+
static_assert(!_Nothrow_callable<void (*)(int), int>);
111+
static_assert(!_Nothrow_callable<void (*)(int), char>);
112+
static_assert(!_Nothrow_callable<void (*)(int), short>);
113+
static_assert(!_Nothrow_callable<void (*)(int), long>);
114+
static_assert(!_Nothrow_callable<void (*)(conversion_target), with_conversion>);
115+
static_assert(!_Nothrow_callable<void (*)(conversion_target), with_explicit_conversion>);
116+
117+
static_assert(_Nothrow_callable<decltype([]() noexcept {})>);
118+
static_assert(!_Nothrow_callable<decltype([]() noexcept {}), int>);
119+
static_assert(_Nothrow_callable<decltype([](int) noexcept {}), int>);
120+
static_assert(_Nothrow_callable<decltype([](int) noexcept {}), char>);
121+
static_assert(_Nothrow_callable<decltype([](int) noexcept {}), short>);
122+
static_assert(_Nothrow_callable<decltype([](int) noexcept {}), long>);
123+
static_assert(_Nothrow_callable<decltype([](int) noexcept {}), long>);
124+
static_assert(_Nothrow_callable<decltype([](conversion_target) noexcept {}), with_conversion>);
125+
static_assert(!_Nothrow_callable<decltype([](conversion_target) noexcept {}), with_explicit_conversion>);
106126
} // namespace callable
107127

108128
// Matching declarations

0 commit comments

Comments
 (0)