Annex C (informative) Compatibility [diff]

C.1 C++ and ISO C++ 2026 [diff.cpp26]

C.1.3 [dcl]: declarations [diff.cpp26.dcl]

Affected subclause: [dcl.init]
Change: Support for designated initialization of base classes of aggregates.

Rationale: New functionality.

Effect on original feature: Some valid C++ 2026 code may fail to compile.
[Example 1: struct A { int a; }; struct B : A { int b; }; void f(A); // #1 void f(B); // #2 void g() { f({.a=1}); // ambiguous between #1 and #2; previously called #1 } — end example]
Affected subclause: [dcl.fct.def.default]
Change: It is no longer valid for explicitly defaulted assignment operators to have a cv-qualifier-seq or && ref-qualifier, or for an explicitly defaulted move assignment operator to have a parameter of type “reference to T” where T is cv-qualified.

Rationale: Removal of rarely-used and confusing feature.

Effect on original feature: A valid C++ 2026 program which uses these features on an explicitly defaulted assignment operator is ill-formed.
[Example 2: struct S { S& operator=(const S&) && = default; // ill-formed; previously well-formed }; struct T { T& operator=(const T&) const = default; // ill-formed; previously well-formed but deleted }; struct U { U& operator=(const U&&) = default; // ill-formed; previously well-formed but deleted }; — end example]