+2019-04-08 Marek Polacek <polacek@redhat.com>
+
+ * typeck2.c (digest_init_r): Don't condition the object slicing warning
+ on flag_checking.
+
2019-04-08 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/89914
/* "If T is a class type and the initializer list has a single
element of type cv U, where U is T or a class derived from T,
the object is initialized from that element." */
- if (flag_checking
- && cxx_dialect >= cxx11
+ if (cxx_dialect >= cxx11
&& BRACE_ENCLOSED_INITIALIZER_P (stripped_init)
&& CONSTRUCTOR_NELTS (stripped_init) == 1
&& ((CLASS_TYPE_P (type) && !CLASSTYPE_NON_AGGREGATE (type))
"results in object slicing", TREE_TYPE (field)))
inform (loc, "remove %<{ }%> around initializer");
}
- else
+ else if (flag_checking)
/* We should have fixed this in reshape_init. */
gcc_unreachable ();
}