Landing: 07b05ad02478

Project / Subsystem

gcc / c++

Date

2026-09-25

Author

Jakub Jelinek

Commit

07b05ad02478dc3291a234ebd2030f49e0259673

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c++
patch_id
—
commit_hash
07b05ad02478dc3291a234ebd2030f49e0259673
source_type
github
headline
C++: Represent aggregate subobjects after std::destroy_at as void_node
tldr
Fixes incorrect lifetime tracking for aggregate subobjects destroyed via std::destroy_at in constant evaluation.
author
Jakub Jelinek
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • c++
  • • constant evaluation
  • • lifetime management
discussion_id_link
—
bugzilla_pr
—
date
2026-09-25T00:00:00.000Z

This change ensures that aggregate subobjects destroyed using std::destroy_at are correctly marked as outside their lifetime during constant evaluation. Previously, only a normal CONSTRUCTOR was recorded, leading to incorrect std::is_within_lifetime checks. By using void_node for these cases, similar to scalar subobjects, the compiler now accurately reflects the object’s state, preventing potential runtime errors. The fix is applied to aggregate types but excludes CLOBBER_OBJECT_START and CLOBBER_STORAGE_START to avoid breaking existing functionality.