Commit 15f4769a by Marek Polacek Committed by Marek Polacek

typeck2.c (digest_init_r): Don't condition the object slicing warning on flag_checking.

	* typeck2.c (digest_init_r): Don't condition the object slicing warning
	on flag_checking.

From-SVN: r270215
parent 04862afe
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> 2019-04-08 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/89914 PR c++/89914
......
...@@ -1200,8 +1200,7 @@ digest_init_r (tree type, tree init, int nested, int flags, ...@@ -1200,8 +1200,7 @@ digest_init_r (tree type, tree init, int nested, int flags,
/* "If T is a class type and the initializer list has a single /* "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, element of type cv U, where U is T or a class derived from T,
the object is initialized from that element." */ the object is initialized from that element." */
if (flag_checking if (cxx_dialect >= cxx11
&& cxx_dialect >= cxx11
&& BRACE_ENCLOSED_INITIALIZER_P (stripped_init) && BRACE_ENCLOSED_INITIALIZER_P (stripped_init)
&& CONSTRUCTOR_NELTS (stripped_init) == 1 && CONSTRUCTOR_NELTS (stripped_init) == 1
&& ((CLASS_TYPE_P (type) && !CLASSTYPE_NON_AGGREGATE (type)) && ((CLASS_TYPE_P (type) && !CLASSTYPE_NON_AGGREGATE (type))
...@@ -1228,7 +1227,7 @@ digest_init_r (tree type, tree init, int nested, int flags, ...@@ -1228,7 +1227,7 @@ digest_init_r (tree type, tree init, int nested, int flags,
"results in object slicing", TREE_TYPE (field))) "results in object slicing", TREE_TYPE (field)))
inform (loc, "remove %<{ }%> around initializer"); inform (loc, "remove %<{ }%> around initializer");
} }
else else if (flag_checking)
/* We should have fixed this in reshape_init. */ /* We should have fixed this in reshape_init. */
gcc_unreachable (); gcc_unreachable ();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment