Commit 3734fb6a by Paolo Carlini Committed by Paolo Carlini

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
parent f4488799
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> 2019-04-19 Jakub Jelinek <jakub@redhat.com>
PR c++/90138 PR c++/90138
......
...@@ -20179,21 +20179,17 @@ fn_type_unification (tree fn, ...@@ -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. */ /* No explicit argument for this template parameter. */
incomplete = true; incomplete = true;
else if (parameter_pack && pack_deducible_p (parm, fn))
if (parameter_pack && pack_deducible_p (parm, fn))
{ {
/* Mark the argument pack as "incomplete". We could /* Mark the argument pack as "incomplete". We could
still deduce more arguments during unification. still deduce more arguments during unification.
We remove this mark in type_unification_real. */ We remove this mark in type_unification_real. */
if (targ) ARGUMENT_PACK_INCOMPLETE_P(targ) = 1;
{ ARGUMENT_PACK_EXPLICIT_ARGS (targ)
ARGUMENT_PACK_INCOMPLETE_P(targ) = 1; = ARGUMENT_PACK_ARGS (targ);
ARGUMENT_PACK_EXPLICIT_ARGS (targ)
= ARGUMENT_PACK_ARGS (targ);
}
/* We have some incomplete argument packs. */ /* We have some incomplete argument packs. */
incomplete = true; incomplete = true;
......
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> 2019-04-19 Jakub Jelinek <jakub@redhat.com>
PR middle-end/90139 PR middle-end/90139
......
// { 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);
}
// { dg-do compile { target c++11 } }
template<typename SX, typename ...XE> void
fk (XE..., int);
void
w9 (void)
{
fk<int> (0);
}
// { 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);
}
// { dg-do compile { target c++11 } }
template<typename ...XE> void
fk (XE..., int);
void
w9 (void)
{
fk (0);
}
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