Annex C (informative)
Compatibility
[diff]
C.2
C++ and ISO C++ 2003
[diff.cpp03]
C.2.5
Clause
[dcl.decl]
: declarators
[diff.cpp03.dcl.decl]
[dcl.init.list]
Change:
Narrowing restrictions in aggregate initializers
.
Rationale:
Catches bugs
.
Effect on original feature:
Valid C++ 2003 code may fail to compile in this International Standard
.
For example, the following code is valid in C++ 2003 but invalid in this International Standard because
double
to
int
is a narrowing conversion:
int x[] = { 2.0 };