diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2019-04-19 15:36:20 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2019-04-19 15:36:20 +0000 |
commit | 3734fb6a274e7574f614bb8139d085e19c85ff9e (patch) | |
tree | 976f7c96dfe1025d98e91210cb01ca0d748966dc | |
parent | f4488799b2827c9db0c13b356055f9bba0e315b6 (diff) | |
download | gcc-3734fb6a274e7574f614bb8139d085e19c85ff9e.zip gcc-3734fb6a274e7574f614bb8139d085e19c85ff9e.tar.gz gcc-3734fb6a274e7574f614bb8139d085e19c85ff9e.tar.bz2 |
re PR c++/89900 (ICE: Segmentation fault (in check_instantiated_arg))
/cp
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.
From-SVN: r270459
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/pt.c | 14 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/pr89900-1.C | 10 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/pr89900-2.C | 10 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/pr89900-3.C | 10 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/pr89900-4.C | 10 |
7 files changed, 59 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index db9a3a8..8eb2953 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 842dacf..6d4140f 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -20179,21 +20179,17 @@ fn_type_unification (tree fn, 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; - - 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. */ - 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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7458b4c..653c201 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 diff --git a/gcc/testsuite/g++.dg/cpp0x/pr89900-1.C b/gcc/testsuite/g++.dg/cpp0x/pr89900-1.C new file mode 100644 index 0000000..e92cd1f --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr89900-1.C @@ -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 index 0000000..a70349d --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr89900-2.C @@ -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 index 0000000..178d8f1 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr89900-3.C @@ -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 index 0000000..0d375da --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr89900-4.C @@ -0,0 +1,10 @@ +// { dg-do compile { target c++11 } } + +template<typename ...XE> void +fk (XE..., int); + +void +w9 (void) +{ + fk (0); +} |