Landing: 9f42a810e669

Project / Subsystem

gcc / c++

Date

2026-05-15

Author

Jason Merrill

Commit

9f42a810e6693a85ed312ca80854733daba75037

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c++
patch_id
commit_hash
9f42a810e6693a85ed312ca80854733daba75037
source_type
github
headline
Handles constexpr nested empty objects correctly.
tldr
GCC now correctly handles nested empty objects in constexpr contexts, preventing errors during compile-time evaluation.
author
Jason Merrill
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • c++
  • constexpr
  • bugfix
discussion_id_link
bugzilla_pr
date
2026-05-15T00:00:00.000Z

GCC’s handling of constexpr nested empty objects was corrected. The compiler did not always create a constructor for the outer object, leading to issues when the inner object needed a context for initialization. This commit ensures that both the constructor and the object can be null for an empty subobject in constexpr contexts. A new test case, g++.dg/cpp2a/no_unique_address16.C, was added.