commit 0d89242428ea0917960bc6b1704605d9bc67bbb0
Author: Jason Merrill <jason@redhat.com>
Date: Thu Dec 6 15:48:56 2012 -0500
PR c++/55249
* tree.c (build_vec_init_elt): Use the type of the initializer.
@@ -524,7 +524,8 @@ build_vec_init_elt (tree type, tree init, tsubst_flags_t complain)
argvec = make_tree_vector ();
if (init)
{
- tree dummy = build_dummy_object (inner_type);
+ tree init_type = strip_array_types (TREE_TYPE (init));
+ tree dummy = build_dummy_object (init_type);
if (!real_lvalue_p (init))
dummy = move (dummy);
argvec->quick_push (dummy);
new file mode 100644
@@ -0,0 +1,18 @@
+// PR c++/55249
+
+template <typename _Tp> struct A
+{
+ _Tp _M_instance[1];
+};
+template <class> struct inner_type
+{
+ inner_type () {}
+ inner_type (inner_type &);
+ inner_type (const inner_type &) {}
+};
+
+int
+main ()
+{
+ A <inner_type <int> > a, b = a;
+}