Landing: e3da9acc2462

Project / Subsystem

gcc / c++

Date

2026-07-30

Author

Marek Polacek

Commit

e3da9acc2462e43e0ce3b9a5d414b988c35595c3

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c++
patch_id
—
commit_hash
e3da9acc2462e43e0ce3b9a5d414b988c35595c3
source_type
github
headline
c++: Fix incorrect array initialization with mixed static/dynamic parts
tldr
Corrects array initialization where parts are declared static and others dynamic, preventing loss of initializer data.
author
Marek Polacek
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • c++
  • • initializer
  • • bugfix
  • • array
discussion_id_link
—
bugzilla_pr
—
date
2026-07-30T00:00:00.000Z

This commit fixes a bug in C++ array initialization that occurred when an array had both static (constant) and dynamic (non-constant) initializers. A recent simplification in checking initializers led to the dynamic part being processed, but then the static part was incorrectly overwritten and lost. The fix prevents this loss of data by ensuring the static initializer is preserved when both types of initializers are present.