File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
libcxx/test/std/utilities/function.objects/func.not_fn Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,14 @@ struct MaybeNoexceptFn {
4747 bool operator ()() const noexcept (IsNoexcept); // not defined
4848};
4949
50+ template <bool IsNoexcept>
51+ struct MaybeNoexceptNegation {
52+ bool operator !() noexcept (IsNoexcept); // not defined
53+ };
54+
55+ template <bool IsNoexcept>
56+ MaybeNoexceptNegation<IsNoexcept> maybe_noexcept_negation () noexcept ; // not defined
57+
5058constexpr void basic_tests () {
5159 { // Test constant functions
5260 auto false_fn = std::not_fn<std::false_type{}>();
@@ -267,6 +275,12 @@ constexpr void test_return_type() {
267275
268276 auto never_noexcept = std::not_fn<MaybeNoexceptFn<false >{}>();
269277 static_assert (!noexcept (never_noexcept ()));
278+
279+ auto always_noexcept_negation = std::not_fn<maybe_noexcept_negation<true >>();
280+ static_assert (noexcept (always_noexcept_negation ()));
281+
282+ auto never_noexcept_negation = std::not_fn<maybe_noexcept_negation<false >>();
283+ static_assert (!noexcept (never_noexcept_negation ()));
270284 }
271285
272286 { // Test calling volatile wrapper
You can’t perform that action at this time.
0 commit comments