Commit cfb82564 by Jason Merrill Committed by Jason Merrill

PR c++/79500 - ICE with non-template deduction guide

	* pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
	DECL_TEMPLATE_RESULT.

From-SVN: r245588
parent de59c92b
2017-02-19 Jason Merrill <jason@redhat.com> 2017-02-19 Jason Merrill <jason@redhat.com>
PR c++/79500 - ICE with non-template deduction guide
* pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
DECL_TEMPLATE_RESULT.
PR c++/79580 - ICE with compound literal PR c++/79580 - ICE with compound literal
* parser.c (cp_parser_class_head): If we're in the middle of an * parser.c (cp_parser_class_head): If we're in the middle of an
expression, use ts_within_enclosing_non_class. expression, use ts_within_enclosing_non_class.
......
...@@ -25118,7 +25118,7 @@ do_class_deduction (tree ptype, tree tmpl, tree init, int flags, ...@@ -25118,7 +25118,7 @@ do_class_deduction (tree ptype, tree tmpl, tree init, int flags,
{ {
tree t = cands; tree t = cands;
for (; t; t = OVL_NEXT (t)) for (; t; t = OVL_NEXT (t))
if (DECL_NONCONVERTING_P (DECL_TEMPLATE_RESULT (OVL_CURRENT (t)))) if (DECL_NONCONVERTING_P (STRIP_TEMPLATE (OVL_CURRENT (t))))
break; break;
if (t) if (t)
{ {
...@@ -25126,7 +25126,7 @@ do_class_deduction (tree ptype, tree tmpl, tree init, int flags, ...@@ -25126,7 +25126,7 @@ do_class_deduction (tree ptype, tree tmpl, tree init, int flags,
for (t = cands; t; t = OVL_NEXT (t)) for (t = cands; t; t = OVL_NEXT (t))
{ {
tree f = OVL_CURRENT (t); tree f = OVL_CURRENT (t);
if (!DECL_NONCONVERTING_P (DECL_TEMPLATE_RESULT (f))) if (!DECL_NONCONVERTING_P (STRIP_TEMPLATE (f)))
pruned = build_overload (f, pruned); pruned = build_overload (f, pruned);
} }
cands = pruned; cands = pruned;
......
// PR c++/79500
// { dg-options -std=c++1z }
template<typename T> struct A {};
A(...) -> A<int>;
A a = {};
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