[diff.cpp23.dcl.dcl]

# Annex C (informative) Compatibility [[diff]](./#diff)

## C.1 C++ and ISO C++ 2023 [[diff.cpp23]](diff.cpp23#dcl.dcl)

### C.1.4 [[dcl]](dcl "9 Declarations"): declarations [diff.cpp23.dcl.dcl]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/compatibility.tex#L110)

**Affected subclause:** [[dcl.decl.general]](dcl.decl.general)  


**Change:** Introduction of trivially_relocatable_if_eligible andreplaceable_if_eligible as identifiers with special meaning ([[lex.name]](lex.name "5.11 Identifiers"))[.](#1.sentence-1)

  


**Rationale:** Support declaration of trivially relocatable and replaceable types ([[class.prop]](class.prop "11.2 Properties of classes"))[.](#1.sentence-2)

  


**Effect on original feature:** Valid C++ 2023 code can become ill-formed[.](#1.sentence-3)

[*Example [1](#example-1)*: struct C {};struct C replaceable_if_eligible {}; // was well-formed (new variable replaceable_if_eligible)// now ill-formed (redefines C) â *end example*]

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/compatibility.tex#L126)

**Affected subclause:** [[dcl.init.list]](dcl.init.list)  


**Change:** Pointer comparisons between initializer_list objects' backing arrays
are unspecified[.](#2.sentence-1)

  


**Rationale:** Permit the implementation to store backing arrays in static read-only memory[.](#2.sentence-2)

  


**Effect on original feature:** Valid C++ 2023 code
that relies on the result of pointer comparison between backing arrays
may change behavior[.](#2.sentence-3)

[*Example [2](#example-2)*: bool ne(std::initializer_list<int> a, std::initializer_list<int> b) {return a.begin() != b.begin() + 1;}bool b = ne({2,3}, {1,2,3}); // unspecified result; previously false â *end example*]

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/compatibility.tex#L145)

**Affected subclause:** [[dcl.array]](dcl.array)  


**Change:** Previously, T...[n] would declare a pack of function parameters[.](#3.sentence-1)

T...[n] is now a [*pack-index-specifier*](dcl.type.pack.index#nt:pack-index-specifier "9.2.9.4 Pack indexing specifier [dcl.type.pack.index]")[.](#3.sentence-2)

  


**Rationale:** Improve the handling of packs[.](#3.sentence-3)

  


**Effect on original feature:** Valid C++ 2023 code that declares a pack of parameters
without specifying a [*declarator-id*](dcl.decl.general#nt:declarator-id "9.3.1 General [dcl.decl.general]") becomes ill-formed[.](#3.sentence-4)

[*Example [3](#example-3)*: template <typename... T>void f(T... [1]);template <typename... T>void g(T... ptr[1]);int main() { f<int, double>(nullptr, nullptr); // ill-formed, previously void f<int, double>(int [1], double [1]) g<int, double>(nullptr, nullptr); // ok} â *end example*]

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/compatibility.tex#L167)

**Affected subclause:** [[dcl.attr.grammar]](dcl.attr.grammar)  


**Change:** New token :][.](#4.sentence-1)

  


**Rationale:** Required for new features[.](#4.sentence-2)

  


**Effect on original feature:** Valid C++ 2023 code that contained an [*attribute-specifier*](dcl.attr.grammar#nt:attribute-specifier "9.13.1 Attribute syntax and semantics [dcl.attr.grammar]") with an [*attribute-using-prefix*](dcl.attr.grammar#nt:attribute-using-prefix "9.13.1 Attribute syntax and semantics [dcl.attr.grammar]") but no attributes and no whitespace is ill-formed in this revision of C++[.](#4.sentence-3)

[*Example [4](#example-4)*: struct [[using CC:]] C; // ill-formed; previously well-formedstruct [[using DD: ]] D; // OK â *end example*]
