
Split 4/8 from: https://chromium-review.googlesource.com/c/chromium/src/+/6055399 This patch addresses inconsistencies in array initialization where the declared array size does not match the number of elements provided in the initializer list. This can lead to confusion and potential errors, as the remaining elements are implicitly initialized to zero. For example, initializing with = {2} might mislead developers into thinking the entire array is filled with 2s, when in fact only the first element is assigned that value. https://godbolt.org/z/4sbd9nreT The changes ensure that: - Array sizes accurately reflect the number of elements being explicitly initialized. - Zero-initialization is explicitly expressed using {} when intended. This improves code clarity and maintainability by making the initialization intent clear and consistent. This change also aims to allow the std::array rewriter to "crash" when encountering a mismatching size where it would be difficult to rewrite. Not having any occurrences of this pattern in the codebase will avoid the issue. Bug: 356643982 Change-Id: I9b7d34aada2302d2f027b9eeb41fc0d26b98a851 AX-Relnotes: n/a. Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6062302 Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org> Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org> Reviewed-by: Colin Blundell <blundell@chromium.org> Cr-Commit-Position: refs/heads/main@{#1391058}