Commit 8be2c871 by Dodji Seketeli Committed by Dodji Seketeli

re PR c++/40684 (ICE in tsubst)

2009-07-09  Dodji Seketeli  <dodji@redhat.com>

gcc/cp/ChangeLog:
	PR c++/40684
	* pt.c (type_unification_real): Use tsubst_template_arg instead
	of tsubst to substitute default template arguments.

gcc/testsuite/ChangeLog:
	PR c++/40684
	* g++.dg/template/unify11.C: New test.

From-SVN: r149423
parent 1aafbf99
2009-07-09 Dodji Seketeli <dodji@redhat.com>
PR c++/40684
* pt.c (type_unification_real): Use tsubst_template_arg instead
of tsubst to substitute default template arguments.
2009-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org> 2009-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/31246 PR c++/31246
......
...@@ -12949,8 +12949,9 @@ type_unification_real (tree tparms, ...@@ -12949,8 +12949,9 @@ type_unification_real (tree tparms,
to explicitly check cxx_dialect here. */ to explicitly check cxx_dialect here. */
if (TREE_PURPOSE (TREE_VEC_ELT (tparms, i))) if (TREE_PURPOSE (TREE_VEC_ELT (tparms, i)))
{ {
tree arg = tsubst (TREE_PURPOSE (TREE_VEC_ELT (tparms, i)), tree arg = tsubst_template_arg
targs, tf_none, NULL_TREE); (TREE_PURPOSE (TREE_VEC_ELT (tparms, i)),
targs, tf_none, NULL_TREE);
if (arg == error_mark_node) if (arg == error_mark_node)
return 1; return 1;
else else
......
2009-07-09 Dodji Seketeli <dodji@redhat.com>
PR c++/40684
* g++.dg/template/unify11.C: New test.
2008-07-09 Paul Thomas <pault@gcc.gnu.org> 2008-07-09 Paul Thomas <pault@gcc.gnu.org>
PR fortran/40629 PR fortran/40629
......
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin: PR c++/40684
// { dg-options "-std=c++0x" }
struct A
{
};
template <typename S, typename T, typename U, typename S::v = &S::v::s>
typename S::A
foo (S c, T t, U u)
{
}
struct B
{
struct C
{
template <typename U>
C (U t)
{
A a;
A b = foo (this, a, t); // { dg-error "no matching function" }
}
} c;
B () : c (A ())
{
}
};
int
main ()
{
B f;
}
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