According to standard 8.5.4.7 A narrowing conversion is an implicit conversion... -from an integer type or unscoped enumeration type to a floating-point type, except where the source is a constant expression and the actual value after conversion will fit into the target type and will produce the original value when converted back to the original type, ... and not allowed at top level. Therefore followings should be generate diagnostics int i=3; double d=i; float f=i; long double ld=i; char c=3; double d=c; etc.. should give narrowing error.
forgot the curly braces.It should have been double d={i} and the compiler gives warning: narrowing conversion of 'i' from 'int' to 'double' inside { } [-Wnarrowing]