@@ -11722,7 +11722,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;
}
}
@@ -12979,7 +12981,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:
{
new file mode 100644
@@ -0,0 +1,9 @@
+// PR c++/47971
+
+template <typename> struct S
+{
+ typedef double T;
+ S () { T ().~T (); }
+};
+
+S<double> s;