Commit ad1f2178 by Paolo Carlini Committed by Paolo Carlini

re PR c++/60859 (Value-initialization of scalar in aggregate yields "braces…

re PR c++/60859 (Value-initialization of scalar in aggregate yields "braces around scalar initializer")

/cp
2014-12-01  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/60859
	* decl.c (reshape_init_r): Do not reject value-initialization of
	scalar array element.

/testsuite
2014-12-01  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/60859
	* g++.dg/cpp0x/initlist88.C: New.

From-SVN: r218244
parent e250f0dc
2014-12-01 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60859
* decl.c (reshape_init_r): Do not reject value-initialization of
scalar array element.
2014-12-01 Marek Polacek <polacek@redhat.com> 2014-12-01 Marek Polacek <polacek@redhat.com>
PR sanitizer/63956 PR sanitizer/63956
......
...@@ -5511,9 +5511,15 @@ reshape_init_r (tree type, reshape_iter *d, bool first_initializer_p, ...@@ -5511,9 +5511,15 @@ reshape_init_r (tree type, reshape_iter *d, bool first_initializer_p,
{ {
if (SCALAR_TYPE_P (type)) if (SCALAR_TYPE_P (type))
{ {
if (complain & tf_error) if (cxx_dialect < cxx11
error ("braces around scalar initializer for type %qT", type); /* Isn't value-initialization. */
init = error_mark_node; || CONSTRUCTOR_NELTS (init) > 0)
{
if (complain & tf_error)
error ("braces around scalar initializer for type %qT",
type);
init = error_mark_node;
}
} }
else else
maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS); maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS);
......
2014-12-01 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60859
* g++.dg/cpp0x/initlist88.C: New.
2014-12-01 Kyrylo Tkachov <kyrylo.tkachov@arm.com> 2014-12-01 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* gcc.target/aarch64/fuse_adrp_add_1.c: Gate test on aarch64_small. * gcc.target/aarch64/fuse_adrp_add_1.c: Gate test on aarch64_small.
......
// PR c++/60859
// { dg-do compile { target c++11 } }
int a[] = { {} };
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