From 03d82c384683ae31f2af20593aacefcfc13d52cd Mon Sep 17 00:00:00 2001 From: Kyle Knoepfel Date: Thu, 23 Jul 2026 11:31:10 -0500 Subject: [PATCH 1/2] Resolve readability-redundant-member-init clang-tidy warning --- form/form/form_source_type_registry.hpp | 2 +- .../storage_associative_write_container.cpp | 2 +- phlex/core/declared_unfold.hpp | 6 +++--- phlex/core/detail/repeater_node.hpp | 4 ++-- phlex/core/framework_graph.hpp | 12 ++++++------ phlex/core/index_router.hpp | 2 +- phlex/core/node_catalog.hpp | 16 ++++++++-------- phlex/core/registrar.hpp | 2 +- phlex/core/store_counters.hpp | 2 +- phlex/model/data_layer_hierarchy.hpp | 2 +- phlex/model/flush_messages.hpp | 2 +- phlex/model/index_generator.hpp | 6 +++--- phlex/model/product_store.hpp | 2 +- test/replicated.cpp | 2 +- 14 files changed, 31 insertions(+), 31 deletions(-) diff --git a/form/form/form_source_type_registry.hpp b/form/form/form_source_type_registry.hpp index a26a8a359..9e4fc767a 100644 --- a/form/form/form_source_type_registry.hpp +++ b/form/form/form_source_type_registry.hpp @@ -20,7 +20,7 @@ namespace form::experimental { struct form_source_type_entry { phlex::detail::type_id type_id; std::type_info const* cpp_type{nullptr}; - form_source_product_from_data_fn product_from_data_fn{}; + form_source_product_from_data_fn product_from_data_fn; }; void register_form_product_type(std::string product_type, diff --git a/form/storage/storage_associative_write_container.cpp b/form/storage/storage_associative_write_container.cpp index d435e2c1a..71d9438c3 100644 --- a/form/storage/storage_associative_write_container.cpp +++ b/form/storage/storage_associative_write_container.cpp @@ -5,7 +5,7 @@ using namespace form::detail::experimental; Storage_Associative_Write_Container::Storage_Associative_Write_Container(std::string const& name) : - Storage_Write_Container::Storage_Write_Container(name), m_tName(), m_cName(), m_parent(nullptr) + Storage_Write_Container::Storage_Write_Container(name), m_parent(nullptr) { auto del_pos = name.find('/'); if (del_pos != std::string::npos) { diff --git a/phlex/core/declared_unfold.hpp b/phlex/core/declared_unfold.hpp index 7d8063a9d..bc16fc850 100644 --- a/phlex/core/declared_unfold.hpp +++ b/phlex/core/declared_unfold.hpp @@ -197,9 +197,9 @@ namespace phlex::detail { tbb::flow::multifunction_node, std::tuple> unfold_; - std::atomic msg_counter_{}; // Is this sufficient? Probably not. - std::atomic calls_{}; - std::atomic product_count_{}; + std::atomic msg_counter_; // Is this sufficient? Probably not. + std::atomic calls_; + std::atomic product_count_; }; } diff --git a/phlex/core/detail/repeater_node.hpp b/phlex/core/detail/repeater_node.hpp index f2fe84aa2..568498f26 100644 --- a/phlex/core/detail/repeater_node.hpp +++ b/phlex/core/detail/repeater_node.hpp @@ -45,9 +45,9 @@ namespace phlex::detail::internal { struct cached_product { std::shared_ptr data_msg; - tbb::concurrent_queue msg_ids{}; + tbb::concurrent_queue msg_ids; std::atomic counter; - std::atomic_flag flush_received{}; + std::atomic_flag flush_received; }; using cache_t = tbb::concurrent_hash_map; // Key is the index hash diff --git a/phlex/core/framework_graph.hpp b/phlex/core/framework_graph.hpp index d0c02aaff..67369b54c 100644 --- a/phlex/core/framework_graph.hpp +++ b/phlex/core/framework_graph.hpp @@ -190,17 +190,17 @@ namespace phlex::detail { enum class driver_mode { default_driver, deferred_driver }; explicit framework_graph(driver_mode mode, int max_parallelism); - resource_usage graph_resource_usage_{}; + resource_usage graph_resource_usage_; max_allowed_parallelism parallelism_limit_; fixed_hierarchy fixed_hierarchy_; data_layer_hierarchy hierarchy_{}; - node_catalog nodes_{}; - std::map filters_{}; + node_catalog nodes_; + std::map filters_; // The graph_ object uses the filters_, nodes_, and hierarchy_ objects implicitly. tbb::flow::graph graph_{}; - std::optional driver_{}; - std::vector registration_errors_{}; - data_cell_tracker cell_tracker_{}; + std::optional driver_; + std::vector registration_errors_; + data_cell_tracker cell_tracker_; tbb::flow::input_node src_; index_router index_router_; tbb::flow::function_node diff --git a/phlex/core/index_router.hpp b/phlex/core/index_router.hpp index 932d6ef6a..5314cafc9 100644 --- a/phlex/core/index_router.hpp +++ b/phlex/core/index_router.hpp @@ -106,7 +106,7 @@ namespace phlex::detail { tbb::flow::function_node unfold_index_receiver_; tbb::flow::function_node unfold_flush_receiver_; - std::atomic received_indices_{}; + std::atomic received_indices_; flusher_t flusher_; tbb::concurrent_unordered_map is_lowest_layer_hashes_; std::vector unfold_input_layer_names_; diff --git a/phlex/core/node_catalog.hpp b/phlex/core/node_catalog.hpp index bfe23ff34..9250c4d31 100644 --- a/phlex/core/node_catalog.hpp +++ b/phlex/core/node_catalog.hpp @@ -106,14 +106,14 @@ namespace phlex::detail { std::vector consumers() const; producer_catalog producers() const; - simple_ptr_map predicates{}; - simple_ptr_map observers{}; - simple_ptr_map outputs{}; - simple_ptr_map folds{}; - simple_ptr_map unfolds{}; - simple_ptr_map transforms{}; - simple_ptr_map providers{}; - simple_ptr_map sources{}; + simple_ptr_map predicates; + simple_ptr_map observers; + simple_ptr_map outputs; + simple_ptr_map folds; + simple_ptr_map unfolds; + simple_ptr_map transforms; + simple_ptr_map providers; + simple_ptr_map sources; private: template diff --git a/phlex/core/registrar.hpp b/phlex/core/registrar.hpp index 294067031..44b31337c 100644 --- a/phlex/core/registrar.hpp +++ b/phlex/core/registrar.hpp @@ -124,7 +124,7 @@ namespace phlex::detail { std::vector* errors_; node_creator creator_{}; std::optional> predicates_; - std::vector output_product_suffixes_{}; + std::vector output_product_suffixes_; }; } diff --git a/phlex/core/store_counters.hpp b/phlex/core/store_counters.hpp index 5b8fd4af1..d3d34ccaa 100644 --- a/phlex/core/store_counters.hpp +++ b/phlex/core/store_counters.hpp @@ -26,7 +26,7 @@ namespace phlex::detail { using counts_t = tbb::concurrent_unordered_map>; - counts_t counts_{}; + counts_t counts_; #ifdef __cpp_lib_atomic_shared_ptr std::atomic flush_counts_{nullptr}; #else diff --git a/phlex/model/data_layer_hierarchy.hpp b/phlex/model/data_layer_hierarchy.hpp index 6a96b491d..bcae315d5 100644 --- a/phlex/model/data_layer_hierarchy.hpp +++ b/phlex/model/data_layer_hierarchy.hpp @@ -51,7 +51,7 @@ namespace phlex::detail { phlex::experimental::identifier name; phlex::experimental::layer_path layer_path; std::size_t parent_hash; - std::atomic count{}; + std::atomic count; }; tbb::concurrent_unordered_map> layers_; diff --git a/phlex/model/flush_messages.hpp b/phlex/model/flush_messages.hpp index 48ef00a0d..663754261 100644 --- a/phlex/model/flush_messages.hpp +++ b/phlex/model/flush_messages.hpp @@ -31,7 +31,7 @@ namespace phlex::detail { // The `ready_flushes_then_emit` struct carries flushes that must be emitted // (to close out already-emitted indices) before emitting `index_to_emit`. struct PHLEX_MODEL_EXPORT ready_flushes_then_emit { - index_flushes ready_flushes{}; + index_flushes ready_flushes; data_cell_index_ptr index_to_emit{nullptr}; }; } diff --git a/phlex/model/index_generator.hpp b/phlex/model/index_generator.hpp index 3b1eaae3e..7a08d0f5b 100644 --- a/phlex/model/index_generator.hpp +++ b/phlex/model/index_generator.hpp @@ -40,7 +40,7 @@ namespace phlex { using handle_type = std::coroutine_handle; struct promise_type { - data_cell_index_ptr current_{}; + data_cell_index_ptr current_; std::exception_ptr exception_{}; index_generator get_return_object() @@ -93,7 +93,7 @@ namespace phlex { } private: - handle_type coroutine_{}; + handle_type coroutine_; }; index_generator() noexcept = default; @@ -148,7 +148,7 @@ namespace phlex { std::default_sentinel_t end() const noexcept { return {}; } private: - handle_type coroutine_{}; + handle_type coroutine_; }; #endif } diff --git a/phlex/model/product_store.hpp b/phlex/model/product_store.hpp index 9cab782b6..3da356603 100644 --- a/phlex/model/product_store.hpp +++ b/phlex/model/product_store.hpp @@ -55,7 +55,7 @@ namespace phlex::experimental { static experimental::algorithm_name default_source(); private: - phlex::detail::products products_{}; + phlex::detail::products products_; data_cell_index_ptr id_; algorithm_name source_; // FIXME: Should not have to copy (the source should outlive the product store) diff --git a/test/replicated.cpp b/test/replicated.cpp index 3945f9b0c..2ab43e413 100644 --- a/test/replicated.cpp +++ b/test/replicated.cpp @@ -17,7 +17,7 @@ namespace { // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) std::atomic processed_messages{}; struct thread_unsafe { - std::atomic counter{}; + std::atomic counter; auto increment(unsigned int i) { From 9dcd9838d7ca133a5b6171092639ee97a6b28394 Mon Sep 17 00:00:00 2001 From: Kyle Knoepfel Date: Thu, 23 Jul 2026 11:31:14 -0500 Subject: [PATCH 2/2] docs: record PR #763 for readability-redundant-member-init clang-tidy fixes --- docs/dev/clang-tidy-fixes-2026-04.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/dev/clang-tidy-fixes-2026-04.md b/docs/dev/clang-tidy-fixes-2026-04.md index 6e3d4085d..42a61a3a3 100644 --- a/docs/dev/clang-tidy-fixes-2026-04.md +++ b/docs/dev/clang-tidy-fixes-2026-04.md @@ -166,7 +166,8 @@ - [ ] [readability-redundant-access-specifiers](https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-access-specifiers.html) (3) - [x] [readability-redundant-control-flow](https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-control-flow.html) (19) - [PR #743](https://github.com/Framework-R-D/phlex/pull/743) -- [ ] [readability-redundant-member-init](https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-member-init.html) (24) +- [x] [readability-redundant-member-init](https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-member-init.html) (24) + - [PR #763](https://github.com/Framework-R-D/phlex/pull/763) - [ ] [readability-redundant-string-cstr](https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-string-cstr.html) (1) - [x] [readability-redundant-string-init](https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-string-init.html) (1) - [PR #716](https://github.com/Framework-R-D/phlex/pull/716)