diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ce4ade16a84..572090ad9a7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2011-03-04 Jason Merrill + PR c++/47971 + * pt.c (tsubst_copy_and_build) [PSEUDO_DTOR_EXPR]: Use tsubst for type. + (tsubst_copy) [default]: Just return t if !ENABLE_CHECKING. + PR c++/46220 * search.c (check_final_overrider): Allow pointer to same incomplete class type with different cv-quals. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index c52bb74eba8..dfc972870f4 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -11727,7 +11727,9 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl) return t; default: - gcc_unreachable (); + /* We shouldn't get here, but keep going if !ENABLE_CHECKING. */ + gcc_checking_assert (false); + return t; } } @@ -12984,7 +12986,7 @@ tsubst_copy_and_build (tree t, return finish_pseudo_destructor_expr (RECUR (TREE_OPERAND (t, 0)), RECUR (TREE_OPERAND (t, 1)), - RECUR (TREE_OPERAND (t, 2))); + tsubst (TREE_OPERAND (t, 2), args, complain, in_decl)); case TREE_LIST: { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c56bea48f04..1e541053e13 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,7 @@ 2011-03-04 Jason Merrill + * g++.dg/template/pseudodtor6.C: New. + * g++.dg/inherit/covariant19.C: New. 2011-03-04 Richard Guenther diff --git a/gcc/testsuite/g++.dg/template/pseudodtor6.C b/gcc/testsuite/g++.dg/template/pseudodtor6.C new file mode 100644 index 00000000000..4438b6ffb33 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/pseudodtor6.C @@ -0,0 +1,9 @@ +// PR c++/47971 + +template struct S +{ + typedef double T; + S () { T ().~T (); } +}; + +S s;