PR c++/66654
* typeck2.c (digest_init_r): Only expect reshaping if the class is
aggregate.
From-SVN: r225082
+2015-06-26 Jason Merrill <jason@redhat.com>
+
+ PR c++/66654
+ * typeck2.c (digest_init_r): Only expect reshaping if the class is
+ aggregate.
+
2015-06-26 Marek Polacek <polacek@redhat.com>
* cp-array-notation.c (expand_sec_reduce_builtin): Use INDIRECT_REF_P.
if (cxx_dialect >= cxx11
&& BRACE_ENCLOSED_INITIALIZER_P (init)
&& CONSTRUCTOR_NELTS (init) == 1
- && (CLASS_TYPE_P (type) || VECTOR_TYPE_P (type)))
+ && ((CLASS_TYPE_P (type) && !CLASSTYPE_NON_AGGREGATE (type))
+ || VECTOR_TYPE_P (type)))
{
tree elt = CONSTRUCTOR_ELT (init, 0)->value;
if (reference_related_p (type, TREE_TYPE (elt)))
--- /dev/null
+// PR c++/66654
+// { dg-do compile { target c++11 } }
+
+class A {
+ A();
+};
+class B {
+ A r{r};
+};