From ce4b132774ca17b04818e273b62ac9c75a5cb59b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sun, 1 Sep 2024 12:42:13 +0100 Subject: [PATCH 1/2] added flags to suppress warning about missing braces --- include/beman/execution26/detail/common.hpp | 5 +++++ include/beman/execution26/detail/connect_all.hpp | 16 +++++----------- include/beman/execution26/detail/make_sender.hpp | 2 +- .../execution26/tests/exec-snd-expos.pass.cpp | 16 ++++++++-------- .../execution26/tests/execution-syn.pass.cpp | 2 +- 5 files changed, 20 insertions(+), 21 deletions(-) diff --git a/include/beman/execution26/detail/common.hpp b/include/beman/execution26/detail/common.hpp index c6d43366..37104157 100644 --- a/include/beman/execution26/detail/common.hpp +++ b/include/beman/execution26/detail/common.hpp @@ -6,6 +6,11 @@ // ---------------------------------------------------------------------------- +#pragma GCC diagnostic ignored "-Wmissing-braces" +#pragma clang diagnostic ignored "-Wmissing-braces" + +// ---------------------------------------------------------------------------- + #if defined(__cpp_deleted_function) # define BEMAN_EXECUTION26_DELETE(msg) delete(msg) #else diff --git a/include/beman/execution26/detail/connect_all.hpp b/include/beman/execution26/detail/connect_all.hpp index 06f83db4..48c8d90f 100644 --- a/include/beman/execution26/detail/connect_all.hpp +++ b/include/beman/execution26/detail/connect_all.hpp @@ -30,20 +30,14 @@ namespace beman::execution26::detail return ::std::apply([&op](auto&&... c){ return [&op]<::std::size_t...J>(::std::index_sequence, auto&&... c){ use(op); - return ::beman::execution26::detail::product_type< - decltype( - ::beman::execution26::connect( - ::beman::execution26::detail::forward_like(c), - ::beman::execution26::detail::basic_receiver>{op} - ))... - >{{ - {::beman::execution26::connect( + return ::beman::execution26::detail::product_type + { + ::beman::execution26::connect( ::beman::execution26::detail::forward_like(c), ::beman::execution26::detail::basic_receiver>{op} - )}... - }}; + )... + }; }(::std::make_index_sequence<::std::tuple_size_v<::std::decay_t>>{}, c...); }, data.children); } diff --git a/include/beman/execution26/detail/make_sender.hpp b/include/beman/execution26/detail/make_sender.hpp index aa0ef798..d3394ab6 100644 --- a/include/beman/execution26/detail/make_sender.hpp +++ b/include/beman/execution26/detail/make_sender.hpp @@ -26,7 +26,7 @@ namespace beman::execution26::detail { return ::beman::execution26::detail::basic_sender< Tag, ::std::decay_t, ::std::decay_t... - >{{{{tag}, {::std::forward(data)}, {child}...}}}; + >{tag, ::std::forward(data), child...}; } } diff --git a/src/beman/execution26/tests/exec-snd-expos.pass.cpp b/src/beman/execution26/tests/exec-snd-expos.pass.cpp index 6bed0f5b..bbc085d1 100644 --- a/src/beman/execution26/tests/exec-snd-expos.pass.cpp +++ b/src/beman/execution26/tests/exec-snd-expos.pass.cpp @@ -928,33 +928,33 @@ namespace nm(nm&&) = delete; auto operator== (nm const&) const -> bool = default; }; - auto p0{test_detail::product_type<>{}}; + auto p0{test_detail::product_type{}}; static_assert(p0.size() == 0u); assert(p0 == p0); - auto p1{test_detail::product_type{nm(1)}}; + auto p1{test_detail::product_type{nm(1)}}; static_assert(p1.size() == 1u); assert(p1.get<0>() == 1); - auto p2{test_detail::product_type{{{nm(1)}, {nm(2)}}}}; + auto p2{test_detail::product_type{nm(1), nm(2)}}; static_assert(p2.size() == 2u); assert(p2.get<0>() == 1); assert(p2.get<1>() == 2); - auto p3{test_detail::product_type{{{nm(1)}, {nm(2)}, {nm(3)}}}}; + auto p3{test_detail::product_type{nm(1), nm(2), nm(3)}}; static_assert(p3.size() == 3u); assert(p3.get<0>() == 1); assert(p3.get<1>() == 2); assert(p3.get<2>() == 3); - auto p4{test_detail::product_type{{{nm(1)}, {nm(2)}, {nm(3)}, {nm(4)}}}}; + auto p4{test_detail::product_type{nm(1), nm(2), nm(3), nm(4)}}; static_assert(p4.size() == 4u); assert(p4.get<0>() == 1); assert(p4.get<1>() == 2); assert(p4.get<2>() == 3); assert(p4.get<3>() == 4); - auto p5{test_detail::product_type{{{nm(1)}, {nm(2)}, {nm(3)}, {nm(4)}, {nm(5)}}}}; + auto p5{test_detail::product_type{nm(1), nm(2), nm(3), nm(4), nm(5)}}; static_assert(p5.size() == 5u); assert(p5.get<0>() == 1); assert(p5.get<1>() == 2); @@ -1191,7 +1191,7 @@ namespace struct env {}; { - auto&&[a, b, c] = tagged_sender{{{{basic_sender_tag{}}, {data{}}, {sender0{}}}}}; + auto&&[a, b, c] = tagged_sender{basic_sender_tag{}, data{}, sender0{}}; use(a); use(b); use(c); @@ -1215,7 +1215,7 @@ namespace using basic_sender = test_detail::basic_sender; static_assert(test_std::sender); - basic_sender bs{{{{basic_sender_tag{}}, {data{}}, {sender0 {}}}}}; + basic_sender bs{basic_sender_tag{}, data{}, sender0 {}}; basic_sender const& cbs{bs}; use(cbs); diff --git a/src/beman/execution26/tests/execution-syn.pass.cpp b/src/beman/execution26/tests/execution-syn.pass.cpp index 204460c9..8ada9758 100644 --- a/src/beman/execution26/tests/execution-syn.pass.cpp +++ b/src/beman/execution26/tests/execution-syn.pass.cpp @@ -425,7 +425,7 @@ namespace } auto operator()(int value) const { - return test_detail::sender_adaptor{{{{*this}, {value}}}, {}}; + return test_detail::sender_adaptor{*this, value, {}}; } }; constexpr arg_closure_t arg_closure{}; From c54ddabd6162f200c099bb9dc1f55abcb9d30a26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sun, 1 Sep 2024 12:46:42 +0100 Subject: [PATCH 2/2] address gcc warning about unknown pragma --- include/beman/execution26/detail/common.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/beman/execution26/detail/common.hpp b/include/beman/execution26/detail/common.hpp index 37104157..4c2b9a4f 100644 --- a/include/beman/execution26/detail/common.hpp +++ b/include/beman/execution26/detail/common.hpp @@ -6,8 +6,13 @@ // ---------------------------------------------------------------------------- -#pragma GCC diagnostic ignored "-Wmissing-braces" -#pragma clang diagnostic ignored "-Wmissing-braces" +#if defined(__GNUC__) +# pragma GCC diagnostic ignored "-Wmissing-braces" +#endif + +#if defined(__clang__) +# pragma clang diagnostic ignored "-Wmissing-braces" +#endif // ----------------------------------------------------------------------------