summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2014-01-28 04:31:14 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2014-01-28 04:31:14 +0000
commitdfd5506e52fb2fd77fe783c2a27e7772020def8a (patch)
tree8daf60fb6401304b094e290db8fd9615f29f3a9a /gcc/cp
parent956043e307c2870431e5891386d03c7a4540d6a3 (diff)
downloadgcc-dfd5506e52fb2fd77fe783c2a27e7772020def8a.tar.gz
PR c++/58606
* pt.c (template_parm_to_arg): Call convert_from_reference. (tsubst_template_arg): Don't strip reference refs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207167 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/pt.c5
2 files changed, 5 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 99c00a237eb..68fa2b99971 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
2014-01-27 Jason Merrill <jason@redhat.com>
+ PR c++/58606
+ * pt.c (template_parm_to_arg): Call convert_from_reference.
+ (tsubst_template_arg): Don't strip reference refs.
+
PR c++/58639
* call.c (build_aggr_conv): Reject value-initialization of reference.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 4414e498fce..661143aae2b 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -3854,6 +3854,7 @@ template_parm_to_arg (tree t)
SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT
(vec, TREE_VEC_LENGTH (vec));
#endif
+ t = convert_from_reference (t);
TREE_VEC_ELT (vec, 0) = make_pack_expansion (t);
t = make_node (NONTYPE_ARGUMENT_PACK);
@@ -9281,10 +9282,6 @@ tsubst_template_arg (tree t, tree args, tsubst_flags_t complain, tree in_decl)
/*integral_constant_expression_p=*/true);
if (!(complain & tf_warning))
--c_inhibit_evaluation_warnings;
- /* Preserve the raw-reference nature of T. */
- if (TREE_TYPE (t) && TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE
- && REFERENCE_REF_P (r))
- r = TREE_OPERAND (r, 0);
}
return r;
}