Landing: c1a7d0a21405

Project / Subsystem

gcc / c++

Date

2026-07-03

Author

Jakub Jelinek

Commit

c1a7d0a2140563198fef1a704029c5a9546e77a0

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c++
patch_id
commit_hash
c1a7d0a2140563198fef1a704029c5a9546e77a0
source_type
github
headline
c++: Implement C++29 P2953R5 - Adding restrictions to defaulted assignment operator functions [PR125826]
tldr
GCC now implements C++29 restrictions on defaulted assignment operators and constructors, aligning with P2953R5.
author
Jakub Jelinek
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • c++
  • language-feature
  • defaulted-functions
  • c++29
discussion_id_link
bugzilla_pr
date
2026-07-03T00:00:00.000Z

This commit implements the C++29 feature described in P2953R5, which adds restrictions to defaulted assignment operator functions and, in some cases, defaulted constructors. The changes primarily affect the maybe_delete_defaulted_fn function, altering its behavior for C++29 to issue errors instead of deleting functions in most cases, with specific exceptions. Checks for when a defaulted function should be deleted or ill-formed are consolidated into this function.