Message ID | 4D90B3AB.1090003@redhat.com |
---|---|
State | New |
Headers | show |
diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 93383c6..9a9ac76 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -1429,7 +1429,9 @@ reference_binding (tree rto, tree rfrom, tree expr, bool c_cast_p, int flags) || (((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] diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist-arrray1.C b/gcc/testsuite/g++.dg/cpp0x/initlist-arrray1.C new file mode 100644 index 0000000..25113d7 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/initlist-arrray1.C @@ -0,0 +1,5 @@ +// { dg-options -std=c++0x } + +typedef int IRT[2]; + +const IRT& ir = IRT{1,2};