From ce19cb2feb8c95550c90ec42004bf14f24fb7c04 Mon Sep 17 00:00:00 2001 From: Ian Petersen Date: Fri, 2 Oct 2026 17:04:51 -0700 Subject: [PATCH] Address -Wdeprecated-declarations When building with Clang 23+, `test_any_sender.cpp` fails to compile because one of the test cases instatiates a deprecated class template (`exec::any_receiver_ref`) inside `std::is_constructible_v`. For some reason, the file-wide `-Wno-deprecated-declarations` pragma doesn't suppress the warning, perhaps because the instantiation of the deprecated class template happens inside the standard library. The error looks like this: ``` error: 'any_receiver_ref>' is deprecated: use exec::any_receiver instead [-Werror,-Wdeprecated-declarations] 27 | ... inline constexpr bool is_constructible_v = __is_constructible(_Tp, _Args...); | ^ ``` This diff suppresses the warning by forcing the first class template instantiation to be inside the blanket suppression (with an otherwise-useless `static_assert(sizeof(type) != 0)`) so that the subsequent use of `std::is_constructible_v` doesn't re-trigger the warning. --- test/exec/test_any_sender.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/exec/test_any_sender.cpp b/test/exec/test_any_sender.cpp index 74b82e058..2bf61ad42 100644 --- a/test/exec/test_any_sender.cpp +++ b/test/exec/test_any_sender.cpp @@ -100,9 +100,12 @@ namespace STATIC_REQUIRE(std::is_copy_assignable_v>); STATIC_REQUIRE(std::is_constructible_v, sink_receiver const &>); STATIC_REQUIRE(!std::is_constructible_v, sink_receiver &&>); - STATIC_REQUIRE( - !std::is_constructible_v>, - sink_receiver const &>); + using void_ref = exec::any_receiver_ref>; + // void_ref names a deprecated partial specialization. Complete it here, inside this + // file's -Wdeprecated-declarations suppression; otherwise it is first completed inside + // libc++'s is_constructible_v, where the suppression doesn't apply. + static_assert(sizeof(void_ref) != 0); + STATIC_REQUIRE(!std::is_constructible_v); } TEST_CASE("exec::any_receiver_ref is queryable", "[types][any_sender]")