diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2017-08-04 22:13:46 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2017-08-04 22:13:46 +0000 |
commit | 67695c075dfa16cc461d6f245d0544078485f9fe (patch) | |
tree | 8e3a23eb46d4d0af3f73a74c0c9be9bd1d6af91c /gcc | |
parent | c779bea5b977aa3df19c965c4866c6c20ad258c8 (diff) | |
download | gcc-67695c075dfa16cc461d6f245d0544078485f9fe.zip gcc-67695c075dfa16cc461d6f245d0544078485f9fe.tar.gz gcc-67695c075dfa16cc461d6f245d0544078485f9fe.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/pt.c | 12 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 |
3 files changed, 19 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 041c6c4..f405108 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +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 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index ee4e6b1..bd61438 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4203037..c936479 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +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 |