summaryrefslogtreecommitdiff
path: root/gcc/cp/method.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/method.c')
-rw-r--r--gcc/cp/method.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index a1bab95049c..ff29b596892 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -500,7 +500,8 @@ add_one_base_init (tree binfo, tree parm, bool move_p, tree inh,
for (; parm; parm = DECL_CHAIN (parm))
{
tree exp = convert_from_reference (parm);
- if (TREE_CODE (TREE_TYPE (parm)) != REFERENCE_TYPE)
+ if (TREE_CODE (TREE_TYPE (parm)) != REFERENCE_TYPE
+ || TYPE_REF_IS_RVALUE (TREE_TYPE (parm)))
exp = move (exp);
*p = build_tree_list (NULL_TREE, exp);
p = &TREE_CHAIN (*p);