Commit da0c8d97 by Jason Merrill Committed by Jason Merrill

PR c++/85215 - ICE with copy-init from conversion.

	* call.c (merge_conversion_sequences): Fix type of direct binding
	sequence.

From-SVN: r259123
parent 67e1eb3d
2018-04-04 Jason Merrill <jason@redhat.com> 2018-04-04 Jason Merrill <jason@redhat.com>
PR c++/85215 - ICE with copy-init from conversion.
* call.c (merge_conversion_sequences): Fix type of direct binding
sequence.
PR c++/84938 - ICE with division by ~-1. PR c++/84938 - ICE with division by ~-1.
* call.c (set_up_extended_ref_temp): Call cp_fully_fold. * call.c (set_up_extended_ref_temp): Call cp_fully_fold.
......
...@@ -3642,6 +3642,12 @@ merge_conversion_sequences (conversion *user_seq, conversion *std_seq) ...@@ -3642,6 +3642,12 @@ merge_conversion_sequences (conversion *user_seq, conversion *std_seq)
(*t)->bad_p = true; (*t)->bad_p = true;
} }
if ((*t)->rvaluedness_matches_p)
/* We're binding a reference directly to the result of the conversion.
build_user_type_conversion_1 stripped the REFERENCE_TYPE from the return
type, but we want it back. */
user_seq->type = TREE_TYPE (TREE_TYPE (user_seq->cand->fn));
/* Replace the identity conversion with the user conversion /* Replace the identity conversion with the user conversion
sequence. */ sequence. */
*t = user_seq; *t = user_seq;
......
// PR c++/85215
// { dg-do compile { target c++11 } }
template <typename _Tp> struct vector {
vector(vector &&) noexcept;
};
template <typename T> struct any_container {
operator vector<T> &&();
};
void f (any_container<int> c)
{
vector<int> shape (c);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment