summaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2016-11-14 15:42:40 +0100
committerRichard Guenther <rguenther@suse.de>2016-11-14 15:42:40 +0100
commitca94f8c64654980144e88fb19b04adf5f023aa55 (patch)
treeef90f8461d210f78e7f7b0ba89923a5eda7b3758 /gcc/cp/tree.c
parent9e872f3fe8b4f6624e2edf5ee55a833e53f290c8 (diff)
parent5dc46e164993bbf658f61069823a1b37a2d715eb (diff)
downloadgcc-gimplefe.tar.gz
Merge remote-tracking branch 'trunk' of git://gcc.gnu.org/git/gcc into gimplefegimplefe
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r--gcc/cp/tree.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 7872dd29cf8..c59543768a8 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -142,6 +142,9 @@ lvalue_kind (const_tree ref)
return clk_none;
/* FALLTHRU */
case VAR_DECL:
+ if (DECL_HAS_VALUE_EXPR_P (ref))
+ return lvalue_kind (DECL_VALUE_EXPR (CONST_CAST_TREE (ref)));
+
if (TREE_READONLY (ref) && ! TREE_STATIC (ref)
&& DECL_LANG_SPECIFIC (ref)
&& DECL_IN_AGGR_P (ref))
@@ -1012,6 +1015,13 @@ tree
cp_build_reference_type (tree to_type, bool rval)
{
tree lvalue_ref, t;
+
+ if (TREE_CODE (to_type) == REFERENCE_TYPE)
+ {
+ rval = rval && TYPE_REF_IS_RVALUE (to_type);
+ to_type = TREE_TYPE (to_type);
+ }
+
lvalue_ref = build_reference_type (to_type);
if (!rval)
return lvalue_ref;