commit 3635dadac4d1e507b80f21f673530f322752df9b
Author: Jason Merrill <jason@redhat.com>
Date: Tue Apr 29 17:08:16 2014 -0400
PR c++/60980
* init.c (build_value_init): Don't try to call an array constructor.
@@ -339,7 +339,8 @@ build_value_init (tree type, tsubst_flags_t complain)
gcc_assert (!processing_template_decl
|| (SCALAR_TYPE_P (type) || TREE_CODE (type) == ARRAY_TYPE));
- if (type_build_ctor_call (type))
+ if (CLASS_TYPE_P (type)
+ && type_build_ctor_call (type))
{
tree ctor = build_aggr_init_expr
(type,
new file mode 100644
@@ -0,0 +1,15 @@
+// PR c++/60980
+// { dg-do compile { target c++11 } }
+
+struct x0
+{
+ x0 () = default;
+};
+struct x1
+{
+ x0 x2[2];
+ void x3 ()
+ {
+ x1 ();
+ }
+};