Comments
Patch
commit 3f54d9656d3e65b396940d2f1227126d61bab91f
Author: Jason Merrill <jason@redhat.com>
Date: Sat Jul 9 00:23:17 2011 -0400
* tree.c (build_vec_init_elt): Strip TARGET_EXPR.
@@ -511,6 +511,11 @@ build_vec_init_elt (tree type, tree init, tsubst_flags_t complain)
complain);
release_tree_vector (argvec);
+ /* For a trivial constructor, build_over_call creates a TARGET_EXPR. But
+ we don't want one here because we aren't creating a temporary. */
+ if (TREE_CODE (init) == TARGET_EXPR)
+ init = TARGET_EXPR_INITIAL (init);
+
return init;
}
new file mode 100644
@@ -0,0 +1,16 @@
+// { dg-options -std=c++0x }
+
+struct A
+{
+ int i;
+ A(int);
+};
+
+struct B
+{
+ virtual void f();
+ A ar[3];
+};
+
+extern B b;
+B b2(b);