X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fcp%2Ftree.c;h=9e194fca44402faa0541a8909ea47aedb35c01ba;hb=d748d5cd08b9a7d6099b640dcb43e8dd91608f89;hp=83869c17a1b51e850bf2969c0c95ddea61e7d69a;hpb=389dd41bd043170e7dc7660304f14a5f16af3562;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 83869c17a1b..9e194fca444 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -214,10 +214,14 @@ lvalue_p_1 (const_tree ref) /* Otherwise, it's an lvalue, and it has all the odd properties contributed by either operand. */ op1_lvalue_kind = op1_lvalue_kind | op2_lvalue_kind; - /* It's not an ordinary lvalue if it involves either a bit-field or - a class rvalue. */ + /* It's not an ordinary lvalue if it involves any other kind. */ if ((op1_lvalue_kind & ~clk_ordinary) != clk_none) op1_lvalue_kind &= ~clk_ordinary; + /* It can't be both a pseudo-lvalue and a non-addressable lvalue. + A COND_EXPR of those should be wrapped in a TARGET_EXPR. */ + if ((op1_lvalue_kind & (clk_rvalueref|clk_class)) + && (op1_lvalue_kind & (clk_bitfield|clk_packed))) + op1_lvalue_kind = clk_none; return op1_lvalue_kind; } @@ -530,7 +534,7 @@ rvalue (tree expr) Non-class rvalues always have cv-unqualified types. */ type = TREE_TYPE (expr); if (!CLASS_TYPE_P (type) && cp_type_quals (type)) - type = TYPE_MAIN_VARIANT (type); + type = cp_build_qualified_type (type, TYPE_UNQUALIFIED); /* We need to do this for rvalue refs as well to get the right answer from decltype; see c++/36628. */