* call.c (build_new_method_call): Also check destructors.
authorMartin v. Löwis <loewis@informatik.hu-berlin.de>
Sat, 1 Jan 2000 13:29:44 +0000 (13:29 +0000)
committerMartin v. Löwis <loewis@gcc.gnu.org>
Sat, 1 Jan 2000 13:29:44 +0000 (13:29 +0000)
From-SVN: r31157

gcc/cp/ChangeLog
gcc/cp/call.c

index 3fb56b09bd61b7782a46ae0d25cac60c82f07a03..630a1fa34db7d2dddb22c6a1498a66cc5b6a0da9 100644 (file)
@@ -1,3 +1,7 @@
+1999-01-01  Martin v. Löwis  <loewis@informatik.hu-berlin.de>
+
+       * call.c (build_new_method_call): Also check destructors.
+
 1999-12-31  Mark Mitchell  <mark@codesourcery.com>
 
        * cp-tree.h (VF_NORMAL_VALUE): Remove.
index fd5cfeecb359a4744d8e1d9459116442d8b7966e..596cc325309f99f9bf2a1f0225503385269b5c1a 100644 (file)
@@ -1,5 +1,5 @@
 /* Functions related to invoking methods and overloaded functions.
-   Copyright (C) 1987, 92-97, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1987, 92-99, 2000 Free Software Foundation, Inc.
    Contributed by Michael Tiemann (tiemann@cygnus.com) and
    modified by Brendan Kehoe (brendan@cygnus.com).
 
@@ -4321,10 +4321,14 @@ build_new_method_call (instance, name, args, basetype_path, flags)
 
   if (DECL_PURE_VIRTUAL_P (cand->fn)
       && instance == current_class_ref
-      && DECL_CONSTRUCTOR_P (current_function_decl)
+      && (DECL_CONSTRUCTOR_P (current_function_decl)
+         || DECL_DESTRUCTOR_P (current_function_decl))
       && ! (flags & LOOKUP_NONVIRTUAL)
       && value_member (cand->fn, CLASSTYPE_PURE_VIRTUALS (basetype)))
-    cp_error ("abstract virtual `%#D' called from constructor", cand->fn);
+    cp_error ((DECL_CONSTRUCTOR_P (current_function_decl) ? 
+              "abstract virtual `%#D' called from constructor"
+              : "abstract virtual `%#D' called from destructor"),
+             cand->fn);
   if (TREE_CODE (TREE_TYPE (cand->fn)) == METHOD_TYPE
       && is_dummy_object (instance_ptr))
     {