* call.c (check_dtor_name): Handle template names correctly.

From-SVN: r39809
This commit is contained in:
Mark Mitchell 2001-02-17 23:54:42 +00:00 committed by Mark Mitchell
parent 3747f3dc72
commit 8084b91ec4
3 changed files with 23 additions and 0 deletions

View 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> 2001-02-16 Jason Merrill <jason@redhat.com>
* cp-tree.h (DECL_USE_VTT_PARM): Remove. * cp-tree.h (DECL_USE_VTT_PARM): Remove.

View File

@ -192,6 +192,15 @@ check_dtor_name (basetype, name)
else else
name = get_type_value (name); 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 else
my_friendly_abort (980605); my_friendly_abort (980605);

View File

@ -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.
}