Annex C (informative) Compatibility [diff]

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


C.1.1 General [diff.cpp26.general]

C.1.2 [basic]: basics [diff.cpp26.basic]

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


C.1.1 General [diff.cpp26.general]

Subclause [diff.cpp26] lists the differences between C++ and ISO C++ 2026, by the chapters of this document.

C.1.2 [basic]: basics [diff.cpp26.basic]

Affected subclause: [basic.stc.dynamic.deallocation]
Change: Potentially throwing exception specifications on deallocation functions are ill-formed.

Rationale: Removes potential undefined behavior.

Effect on original feature: Valic C++ 2026 code that declares a deallocation function with a potentially throwing exception specification becomes ill-formed.
[Example 1: struct T { void operator delete(void *) noexcept(false); // ill-formed; previously well-formed }; — end example]

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]