Commit 17c6c56b by Ryan Burn Committed by Jason Merrill

re PR c++/68683 ([concepts] function satisfy_argument_deduction_constraint…

re PR c++/68683 ([concepts] function satisfy_argument_deduction_constraint modifies a type tree node but leaves TYPE_CANONICAL unchanged)

	PR c++/68683
	* constraint.cc (satisfy_argument_deduction_constraint): Set
	TYPE_CANONICAL to NULL_TREE if PLACEHOLDER_TYPE_CONSTRAINTS are
	changed.

From-SVN: r231385
parent 0be72a6b
2015-12-07 Ryan Burn <contact@rnburn.com>
PR c++/68683
* constraint.cc (satisfy_argument_deduction_constraint): Set
TYPE_CANONICAL to NULL_TREE if PLACEHOLDER_TYPE_CONSTRAINTS are
changed.
2015-12-07 Jason Merrill <jason@redhat.com>
PR c++/68464
......
......@@ -1871,11 +1871,14 @@ satisfy_argument_deduction_constraint (tree t, tree args,
tree pattern = DEDUCT_CONSTR_PATTERN (t);
tree placeholder = DEDUCT_CONSTR_PLACEHOLDER (t);
tree constr = PLACEHOLDER_TYPE_CONSTRAINTS (placeholder);
tree type_canonical = TYPE_CANONICAL (placeholder);
PLACEHOLDER_TYPE_CONSTRAINTS (placeholder)
= tsubst_constraint (constr, args, complain|tf_partial, in_decl);
TYPE_CANONICAL (placeholder) = NULL_TREE;
tree type = do_auto_deduction (pattern, init, placeholder,
complain, adc_requirement);
PLACEHOLDER_TYPE_CONSTRAINTS (placeholder) = constr;
TYPE_CANONICAL (placeholder) = type_canonical;
if (type == error_mark_node)
return boolean_false_node;
......
// { dg-options "-std=c++1z" }
template <typename, typename>
struct is_same {
static constexpr bool value = true;
};
template <typename T, typename U>
concept bool Same = is_same<T, U>::value;
template <typename T>
concept bool Integral = requires {
{ T () } -> Same<typename T::value_type>;
};
struct A {
using value_type = bool;
};
int main () {
Integral<A>;
Integral<A>;
return 0;
}
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