Landing: eed9f52920aa

Project / Subsystem

gcc / c++

Date

2026-09-25

Author

Jakub Jelinek

Commit

eed9f52920aa362866eab84886dc47b0a38944b0

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c++
patch_id
—
commit_hash
eed9f52920aa362866eab84886dc47b0a38944b0
source_type
github
headline
C++: Implement C++26 P3769R1 deallocation clarification for placement new
tldr
Implements C++26 P3769R1, clarifying deallocation for placement new by selecting the correct deallocation function.
author
Jakub Jelinek
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • c++
  • • exception handling
  • • placement new
  • • standardization
discussion_id_link
—
bugzilla_pr
—
date
2026-09-25T00:00:00.000Z

This commit implements the C++26 paper P3769R1, which clarifies the deallocation process for objects allocated with placement new. The compiler now correctly selects the appropriate deallocation function from a list of candidates, considering template argument deduction and constraints. This change resolves ambiguities in handling deallocation during exceptions and aligns GCC’s behavior with the standard’s intent, particularly for cases previously influenced by the pending CWG901 resolution. A new test case placement-new1.C is included.