Commit 67695c07 by Paolo Carlini Committed by Paolo Carlini

re PR c++/79790 ([C++17] ICE class template argument deduction failed)

/cp
2017-08-04  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/79790
	* pt.c (do_class_deduction): Handle the case of no viable implicit
	deduction guides; simplify the code generating implicit deduction
	guides.

/testsuite
2017-08-04  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/79790
	* g++.dg/cpp1z/class-deduction42.C: New.

From-SVN: r250882
parent c779bea5
2017-08-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/79790
* pt.c (do_class_deduction): Handle the case of no viable implicit
deduction guides; simplify the code generating implicit deduction
guides.
2017-08-03 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71440
......
......@@ -25452,11 +25452,7 @@ do_class_deduction (tree ptype, tree tmpl, tree init, int flags,
if (gtype)
{
tree guide = build_deduction_guide (gtype, outer_args, complain);
if ((flags & LOOKUP_ONLYCONVERTING)
&& DECL_NONCONVERTING_P (STRIP_TEMPLATE (guide)))
elided = true;
else
cands = lookup_add (guide, cands);
cands = lookup_add (guide, cands);
}
}
......@@ -25467,6 +25463,12 @@ do_class_deduction (tree ptype, tree tmpl, tree init, int flags,
"user-declared constructors", type);
return error_mark_node;
}
else if (!cands && call == error_mark_node)
{
error ("cannot deduce template arguments of %qT, as it has no viable "
"deduction guides", type);
return error_mark_node;
}
if (call == error_mark_node)
{
......
2017-08-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/79790
* g++.dg/cpp1z/class-deduction42.C: New.
2017-08-04 Yury Gribov <tetra2005@gmail.com>
PR tree-optimization/57371
......
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