[diff.cpp03.dcl.dcl]

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

## C.6 C++ and ISO C++ 2003 [[diff.cpp03]](diff.cpp03#dcl.dcl)

### C.6.4 [[dcl]](dcl "9 Declarations"): declarations [diff.cpp03.dcl.dcl]

[1](#1)

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

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


**Change:** Remove auto as a storage class specifier[.](#1.sentence-1)

  


**Rationale:** New feature[.](#1.sentence-2)

  


**Effect on original feature:** Valid C++ 2003 code that uses the keyword auto as a storage class
specifier
may be invalid in this revision of C++[.](#1.sentence-3)

In this revision of C++,auto indicates that the type of a variable is to be deduced
from its initializer expression[.](#1.sentence-4)

[2](#2)

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

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


**Change:** Narrowing restrictions in aggregate initializers[.](#2.sentence-1)

  


**Rationale:** Catches bugs[.](#2.sentence-2)

  


**Effect on original feature:** Valid C++ 2003 code may fail to compile in this revision of C++[.](#2.sentence-3)

[*Example [1](#example-1)*: int x[] = { 2.0 };

This code is valid in C++ 2003 but invalid in this
revision of C++ because double to int is a narrowing
conversion[.](#2.sentence-4)

â *end example*]

[3](#3)

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

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


**Change:** Names declared in an anonymous namespace
changed from external linkage to internal linkage;
language linkage applies to names with external linkage only[.](#3.sentence-1)

  


**Rationale:** Alignment with user expectations[.](#3.sentence-2)

  


**Effect on original feature:** Valid C++ 2003 code may violate the one-definition rule ([[basic.def.odr]](basic.def.odr "6.3 One-definition rule"))
in this revision of C++[.](#3.sentence-3)

[*Example [2](#example-2)*: namespace { extern "C" { extern int x; } } // #1, previously external linkage and C language linkage,// now internal linkage and C++ language linkagenamespace A { extern "C" int x = 42; } // #2, external linkage and C language linkageint main(void) { return x; }

This code is valid in C++ 2003,
but #2 is not a definition for #1 in this revision of C++, violating the one-definition rule[.](#3.sentence-4)

â *end example*]
