* call.c (check_dtor_name): Handle template names correctly.
authorMark Mitchell <mark@codesourcery.com>
Sat, 17 Feb 2001 23:54:42 +0000 (23:54 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Sat, 17 Feb 2001 23:54:42 +0000 (23:54 +0000)
From-SVN: r39809

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/testsuite/g++.old-deja/g++.other/dtor13.C [new file with mode: 0644]

index 12050699c92dfe5d8a1cc49a3cf588edebad7ee3..1c557bd0d118c67d7af45be26d56325b6dc9c884 100644 (file)
@@ -1,3 +1,7 @@
+2001-02-17  Mark Mitchell  <mark@codesourcery.com>
+
+       * call.c (check_dtor_name): Handle template names correctly.
+
 2001-02-16  Jason Merrill  <jason@redhat.com>
 
        * cp-tree.h (DECL_USE_VTT_PARM): Remove.
index f11929b095ef6304eea7d79fef98e75f1ae8c913..184ffeb64667bfd29e81f7cc97c0bbb43d66f387 100644 (file)
@@ -192,6 +192,15 @@ check_dtor_name (basetype, name)
       else
        name = get_type_value (name);
     }
+  /* In the case of:
+      
+       template <class T> struct S { ~S(); };
+       int i;
+       i.~S();
+
+     NAME will be a class template.  */
+  else if (DECL_CLASS_TEMPLATE_P (name))
+    return 0;
   else
     my_friendly_abort (980605);
 
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dtor13.C b/gcc/testsuite/g++.old-deja/g++.other/dtor13.C
new file mode 100644 (file)
index 0000000..49c02ec
--- /dev/null
@@ -0,0 +1,10 @@
+// Build don't link:
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+template <class T> struct S { ~S(); };
+int i;
+
+void f () 
+{
+  i.~S(); // ERROR - invalid destructor call.
+}