[libcxx-commits] [libcxx] [libc++][test] Add default member initializers to `TestCaseMapSet` (PR #107145)
via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Sep 3 12:32:47 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: Casey Carter (CaseyCarter)
<details>
<summary>Changes</summary>
These do-nothing initializers (`Buffer<T>` is fully initialized, so value-init and default-init are equivalent) silence Clang 18 `-Wmissing-field-initializers` warnings when the functions in the same header use designated initializers for `TestCaseMapSet`. (Clang 19+ doesn't emit this warning for designated initializers.)
---
Full diff: https://github.com/llvm/llvm-project/pull/107145.diff
1 Files Affected:
- (modified) libcxx/test/std/containers/insert_range_maps_sets.h (+4-4)
``````````diff
diff --git a/libcxx/test/std/containers/insert_range_maps_sets.h b/libcxx/test/std/containers/insert_range_maps_sets.h
index 82fea93b68fe37..78af8ac66aacc8 100644
--- a/libcxx/test/std/containers/insert_range_maps_sets.h
+++ b/libcxx/test/std/containers/insert_range_maps_sets.h
@@ -70,10 +70,10 @@ constexpr bool test_map_constraints_insert_range() {
template <class T>
struct TestCaseMapSet {
- Buffer<T> initial;
- Buffer<T> input;
- Buffer<T> expected;
- Buffer<T> expected_multi;
+ Buffer<T> initial{};
+ Buffer<T> input{};
+ Buffer<T> expected{};
+ Buffer<T> expected_multi{};
};
// Empty container.
``````````
</details>
https://github.com/llvm/llvm-project/pull/107145
More information about the libcxx-commits
mailing list