diff options
author | Dodji Seketeli <dodji@redhat.com> | 2009-07-09 17:56:44 +0000 |
---|---|---|
committer | Dodji Seketeli <dodji@gcc.gnu.org> | 2009-07-09 19:56:44 +0200 |
commit | 8be2c87161b7db3a5067bd0e1a5b5565744680a2 (patch) | |
tree | 0acb31e568aebeb03f71fd059ddd620dbaed8767 /gcc | |
parent | 1aafbf99427843b553de817302453bf126592553 (diff) | |
download | gcc-8be2c87161b7db3a5067bd0e1a5b5565744680a2.tar.gz |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/pt.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/unify11.C | 36 |
4 files changed, 50 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3919397dfcc..8e3b90704c6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +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> PR c++/31246 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index b4bd465860e..d042f98f9a3 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -12949,8 +12949,9 @@ type_unification_real (tree tparms, to explicitly check cxx_dialect here. */ if (TREE_PURPOSE (TREE_VEC_ELT (tparms, i))) { - tree arg = tsubst (TREE_PURPOSE (TREE_VEC_ELT (tparms, i)), - targs, tf_none, NULL_TREE); + tree arg = tsubst_template_arg + (TREE_PURPOSE (TREE_VEC_ELT (tparms, i)), + targs, tf_none, NULL_TREE); if (arg == error_mark_node) return 1; else diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e04e25e8753..d9f3bfe4e40 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +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> PR fortran/40629 diff --git a/gcc/testsuite/g++.dg/template/unify11.C b/gcc/testsuite/g++.dg/template/unify11.C new file mode 100644 index 00000000000..c8df94b31ca --- /dev/null +++ b/gcc/testsuite/g++.dg/template/unify11.C @@ -0,0 +1,36 @@ +// 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; +} + |