]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/60980 (ICE in build_special_member_call, at cp/call.c:7447)
authorJason Merrill <jason@redhat.com>
Wed, 30 Apr 2014 14:23:18 +0000 (10:23 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 30 Apr 2014 14:23:18 +0000 (10:23 -0400)
PR c++/60980
* init.c (build_value_init): Don't try to call an array constructor.

From-SVN: r209934

gcc/cp/ChangeLog
gcc/cp/init.c
gcc/testsuite/g++.dg/cpp0x/defaulted49.C [new file with mode: 0644]

index a3878830a6e1e1d3dec25ae7bb78302c8b93af9c..c078e0685cc29bf57a7b839e84cdb96a67b6e524 100644 (file)
@@ -1,5 +1,8 @@
 2014-04-30  Jason Merrill  <jason@redhat.com>
 
+       PR c++/60980
+       * init.c (build_value_init): Don't try to call an array constructor.
+
        PR c++/60951
        * typeck2.c (massage_init_elt): Use maybe_constant_init.
 
index 8b9405c54edb97a536abd794e7b289b03160c9f9..46422a52304bd0f4bb1cc8d7df490e770042bcc1 100644 (file)
@@ -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,
diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted49.C b/gcc/testsuite/g++.dg/cpp0x/defaulted49.C
new file mode 100644 (file)
index 0000000..357be41
--- /dev/null
@@ -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 ();
+  }
+};