]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
/cp
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Aug 2017 22:13:46 +0000 (22:13 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Aug 2017 22:13:46 +0000 (22:13 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250882 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog

index 041c6c44bbecf0aeb47efb4629d1eeea490d649c..f4051080c936674ad32d2203e4976ebcec67a93a 100644 (file)
@@ -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
index ee4e6b113341387ee882c629ef8e51b7c73779f1..bd61438fc39d834a473d440f47dbf8415800487a 100644 (file)
@@ -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)
     {
index 4203037994dcdddf8f6480a1d5c3418361ecc3e6..c936479fbfb27176b14978ee289a691204001829 100644 (file)
@@ -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