]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/40373 (ICE with invalid destructor call)
authorJakub Jelinek <jakub@redhat.com>
Mon, 8 Jun 2009 17:02:17 +0000 (19:02 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 8 Jun 2009 17:02:17 +0000 (19:02 +0200)
PR c++/40373
* call.c (check_dtor_name): Return false even if
get_type_value (name) is error_mark_node.

* g++.dg/template/dtor7.C: New test.

From-SVN: r148284

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

index b5d7a52e574e5fa634d814ad0c379dc1923c0719..f78375e123d8449656065421e0dbd57c5c35edbc 100644 (file)
@@ -1,3 +1,9 @@
+2009-06-08  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/40373
+       * call.c (check_dtor_name): Return false even if
+       get_type_value (name) is error_mark_node.
+
 2009-06-04  Richard Guenther  <rguenther@suse.de>
 
        Backport from mainline
index fb2420f2a596fe6ff271485759fe6fedb297a293..d180111c66bf6ba8609646d1a873da6e24a6a0a7 100644 (file)
@@ -234,7 +234,7 @@ check_dtor_name (tree basetype, tree name)
       return false;
     }
 
-  if (!name)
+  if (!name || name == error_mark_node)
     return false;
   return same_type_p (TYPE_MAIN_VARIANT (basetype), TYPE_MAIN_VARIANT (name));
 }
index 540110f71171b47636d243ecb9048027f5f7f2cd..3c0a7af86c07df9795082cd2148083320f7ae9f4 100644 (file)
@@ -1,3 +1,8 @@
+2009-06-08  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/40373
+       * g++.dg/template/dtor7.C: New test.
+
 2009-06-07  H.J. Lu  <hongjiu.lu@intel.com>
 
        Backport from mainline:
diff --git a/gcc/testsuite/g++.dg/template/dtor7.C b/gcc/testsuite/g++.dg/template/dtor7.C
new file mode 100644 (file)
index 0000000..0dac69e
--- /dev/null
@@ -0,0 +1,24 @@
+// PR c++/40373
+// { dg-compile }
+
+struct A;      // { dg-bogus "candidates are" "" { xfail *-*-* } }
+namespace
+{
+  struct A;    // { dg-bogus "struct" "" { xfail *-*-* } }
+}
+
+struct B {};
+
+template <typename T> void
+foo (T t)
+{
+  t.~A ();     // { dg-error "does not match destructor name" }
+}
+
+void
+bar ()
+{
+  foo (B ());  // { dg-bogus "instantiated from here" "" { xfail *-*-* } }
+}
+
+// { dg-bogus "is ambiguous" "" { xfail *-*-* } 15 }