OSDN Git Service

PR c++/47971
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Mar 2011 15:18:07 +0000 (15:18 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Mar 2011 15:18:07 +0000 (15:18 +0000)
* pt.c (tsubst_copy_and_build) [PSEUDO_DTOR_EXPR]: Use tsubst for type.
(tsubst_copy) [default]: Just return t if !ENABLE_CHECKING.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170677 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/pseudodtor6.C [new file with mode: 0644]

index ce4ade1..572090a 100644 (file)
@@ -1,5 +1,9 @@
 2011-03-04  Jason Merrill  <jason@redhat.com>
 
+       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.
index c52bb74..dfc9728 100644 (file)
@@ -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:
       {
index c56bea4..1e54105 100644 (file)
@@ -1,5 +1,7 @@
 2011-03-04  Jason Merrill  <jason@redhat.com>
 
+       * g++.dg/template/pseudodtor6.C: New.
+
        * g++.dg/inherit/covariant19.C: New.
 
 2011-03-04  Richard Guenther  <rguenther@suse.de>
diff --git a/gcc/testsuite/g++.dg/template/pseudodtor6.C b/gcc/testsuite/g++.dg/template/pseudodtor6.C
new file mode 100644 (file)
index 0000000..4438b6f
--- /dev/null
@@ -0,0 +1,9 @@
+// PR c++/47971
+
+template <typename> struct S
+{
+  typedef double T;
+  S () { T ().~T (); }
+};
+
+S<double> s;