]> code.ossystems Code Review - openembedded-core.git/blob
a941c5d17205d2d58667fad658cc316c2b657880
[openembedded-core.git] /
1 Upstream-Status: Inappropriate [Backport]
2 From af19d0c50df96adb55baaf54026ad82a9d256868 Mon Sep 17 00:00:00 2001
3 From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
4 Date: Tue, 29 Mar 2011 14:26:00 +0000
5 Subject: [PATCH 031/200]        * call.c (reference_binding): Allow direct binding to an array
6         rvalue.
7
8 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@171672 138bc75d-0d04-0410-961f-82ee72b054a4
9
10 index ac625a0..2ff3745 100644
11 --- a/gcc/cp/call.c
12 +++ b/gcc/cp/call.c
13 @@ -1429,7 +1429,9 @@ reference_binding (tree rto, tree rfrom, tree expr, bool c_cast_p, int flags)
14           || (((CP_TYPE_CONST_NON_VOLATILE_P (to)
15                 && !(flags & LOOKUP_NO_TEMP_BIND))
16                || TYPE_REF_IS_RVALUE (rto))
17 -             && (CLASS_TYPE_P (from) || (expr && lvalue_p (expr))))))
18 +             && (CLASS_TYPE_P (from)
19 +                 || TREE_CODE (from) == ARRAY_TYPE
20 +                 || (expr && lvalue_p (expr))))))
21      {
22        /* [dcl.init.ref]
23  
24 new file mode 100644
25 index 0000000..25113d7
26 --- /dev/null
27 +++ b/gcc/testsuite/g++.dg/cpp0x/initlist-arrray1.C
28 @@ -0,0 +1,5 @@
29 +// { dg-options -std=c++0x }
30 +
31 +typedef int IRT[2];
32 +
33 +const IRT& ir = IRT{1,2};
34 -- 
35 1.7.0.4
36