]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
/cp
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 19 Apr 2019 15:36:20 +0000 (15:36 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 19 Apr 2019 15:36:20 +0000 (15:36 +0000)
2019-04-19  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/89900
* pt.c (fn_type_unification): When handling null explicit
arguments do not special case non-parameter packs.

/testsuite
2019-04-19  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/89900
* g++.dg/cpp0x/pr89900-1.C: New.
* g++.dg/cpp0x/pr89900-2.C: Likewise.
* g++.dg/cpp0x/pr89900-3.C: Likewise.
* g++.dg/cpp0x/pr89900-4.C: Likewise.

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

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr89900-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/pr89900-2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/pr89900-3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/pr89900-4.C [new file with mode: 0644]

index db9a3a8d4be48a0f2c285989ae9162cd6a1abba9..8eb2953e051e96c6e8c3678f61add7bc903eaa18 100644 (file)
@@ -1,3 +1,9 @@
+2019-04-19  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/89900
+       * pt.c (fn_type_unification): When handling null explicit
+       arguments do not special case non-parameter packs.
+
 2019-04-19  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/90138
 2019-04-19  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/90138
index 842dacf95431c638a149afcd2f0d2ecf0989cb5d..6d4140fb018eacb998a75de54ea69c95f566ae50 100644 (file)
@@ -20179,21 +20179,17 @@ fn_type_unification (tree fn,
               parameter_pack = TEMPLATE_PARM_PARAMETER_PACK (parm);
             }
 
               parameter_pack = TEMPLATE_PARM_PARAMETER_PACK (parm);
             }
 
-         if (!parameter_pack && targ == NULL_TREE)
+         if (targ == NULL_TREE)
            /* No explicit argument for this template parameter.  */
            incomplete = true;
            /* No explicit argument for this template parameter.  */
            incomplete = true;
-
-          if (parameter_pack && pack_deducible_p (parm, fn))
+         else if (parameter_pack && pack_deducible_p (parm, fn))
             {
               /* Mark the argument pack as "incomplete". We could
                  still deduce more arguments during unification.
                 We remove this mark in type_unification_real.  */
             {
               /* Mark the argument pack as "incomplete". We could
                  still deduce more arguments during unification.
                 We remove this mark in type_unification_real.  */
-              if (targ)
-                {
-                  ARGUMENT_PACK_INCOMPLETE_P(targ) = 1;
-                  ARGUMENT_PACK_EXPLICIT_ARGS (targ) 
-                    = ARGUMENT_PACK_ARGS (targ);
-                }
+             ARGUMENT_PACK_INCOMPLETE_P(targ) = 1;
+             ARGUMENT_PACK_EXPLICIT_ARGS (targ)
+               = ARGUMENT_PACK_ARGS (targ);
 
               /* We have some incomplete argument packs.  */
               incomplete = true;
 
               /* We have some incomplete argument packs.  */
               incomplete = true;
index 7458b4cc2ef9c3d11ba83658cb683622270e19ed..653c20113c64470beb9a6067ef65426d30db988d 100644 (file)
@@ -1,3 +1,11 @@
+2019-04-19  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/89900
+       * g++.dg/cpp0x/pr89900-1.C: New.
+       * g++.dg/cpp0x/pr89900-2.C: Likewise.
+       * g++.dg/cpp0x/pr89900-3.C: Likewise.
+       * g++.dg/cpp0x/pr89900-4.C: Likewise.
+
 2019-04-19  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/90139
 2019-04-19  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/90139
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr89900-1.C b/gcc/testsuite/g++.dg/cpp0x/pr89900-1.C
new file mode 100644 (file)
index 0000000..e92cd1f
--- /dev/null
@@ -0,0 +1,10 @@
+// { dg-do compile { target c++11 } }
+
+template<typename SX, typename ...XE> void
+fk (XE..., SW);  // { dg-error "12:.SW. has not been declared" }
+
+void
+w9 (void)
+{
+  fk<int> (0);
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr89900-2.C b/gcc/testsuite/g++.dg/cpp0x/pr89900-2.C
new file mode 100644 (file)
index 0000000..a70349d
--- /dev/null
@@ -0,0 +1,10 @@
+// { dg-do compile { target c++11 } }
+
+template<typename SX, typename ...XE> void
+fk (XE..., int);
+
+void
+w9 (void)
+{
+  fk<int> (0);
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr89900-3.C b/gcc/testsuite/g++.dg/cpp0x/pr89900-3.C
new file mode 100644 (file)
index 0000000..178d8f1
--- /dev/null
@@ -0,0 +1,10 @@
+// { dg-do compile { target c++11 } }
+
+template<typename ...XE> void
+fk (XE..., SW);  // { dg-error "12:.SW. has not been declared" }
+
+void
+w9 (void)
+{
+  fk (0);
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr89900-4.C b/gcc/testsuite/g++.dg/cpp0x/pr89900-4.C
new file mode 100644 (file)
index 0000000..0d375da
--- /dev/null
@@ -0,0 +1,10 @@
+// { dg-do compile { target c++11 } }
+
+template<typename ...XE> void
+fk (XE..., int);
+
+void
+w9 (void)
+{
+  fk (0);
+}