diff options
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/call.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/dtor13.C | 10 |
3 files changed, 23 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1205069..1c557bd 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index f11929b..184ffeb 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -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 index 0000000..49c02ec --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/dtor13.C @@ -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. +} |