Commit 349c6351 by Jason Merrill Committed by Jason Merrill

* pt.c (do_class_deduction): Handle 0 argument case.

From-SVN: r245665
parent e40b6fc7
2017-02-22 Jason Merrill <jason@redhat.com>
* pt.c (do_class_deduction): Handle 0 argument case.
2017-02-22 Jakub Jelinek <jakub@redhat.com>
PR c++/79664
......
......@@ -25126,6 +25126,14 @@ do_class_deduction (tree ptype, tree tmpl, tree init, int flags,
if (cands == NULL_TREE)
{
if (args->length() == 0)
{
/* Try tmpl<>. */
tree t = lookup_template_class (tmpl, NULL_TREE, NULL_TREE,
NULL_TREE, false, tf_none);
if (t != error_mark_node)
return t;
}
error ("cannot deduce template arguments for %qT, as it has "
"no deduction guides or user-declared constructors", type);
return error_mark_node;
......
// { dg-options -std=c++1z }
template <class T = void> struct A { };
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