* call.c (reference_binding): Allow direct binding to an array
rvalue.
From-SVN: r171613
2011-03-28 Jason Merrill <jason@redhat.com>
+ * call.c (reference_binding): Allow direct binding to an array
+ rvalue.
+
Core 898
* parser.c (cp_parser_compound_statement): Add function_body parm.
Complain about non-body compound-stmt in constexpr fn.
|| (((CP_TYPE_CONST_NON_VOLATILE_P (to)
&& !(flags & LOOKUP_NO_TEMP_BIND))
|| TYPE_REF_IS_RVALUE (rto))
- && (CLASS_TYPE_P (from) || (expr && lvalue_p (expr))))))
+ && (CLASS_TYPE_P (from)
+ || TREE_CODE (from) == ARRAY_TYPE
+ || (expr && lvalue_p (expr))))))
{
/* [dcl.init.ref]
2011-03-28 Jason Merrill <jason@redhat.com>
+ * g++.dg/cpp0x/initlist-array1.C: New.
+
* g++.dg/cpp0x/constexpr-compound.C: New.
* g++.dg/cpp0x/constexpr-using.C: New.
--- /dev/null
+// { dg-options -std=c++0x }
+
+typedef int IRT[2];
+
+const IRT& ir = IRT{1,2};