summaryrefslogtreecommitdiff
path: root/gcc/cp/method.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2013-02-12 20:47:15 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2013-02-12 20:47:15 +0000
commit65e921ca1d1efd8e13443b011de59fb711195917 (patch)
treef05abda8609ab1a622c223269ac2c8b5692d6b47 /gcc/cp/method.c
parentb862f263d5146ad1c75d1dbfa5a2bc5459ebff32 (diff)
downloadgcc-65e921ca1d1efd8e13443b011de59fb711195917.tar.gz
PR c++/56285
* method.c (add_one_base_init): Handle base constructor taking rvalue reference parm. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195990 138bc75d-0d04-0410-961f-82ee72b054a4
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);