summaryrefslogtreecommitdiffstats
path: root/gcc/cp/call.c
diff options
context:
space:
mode:
authorloewis <loewis@138bc75d-0d04-0410-961f-82ee72b054a4>2000-01-01 13:29:44 +0000
committerloewis <loewis@138bc75d-0d04-0410-961f-82ee72b054a4>2000-01-01 13:29:44 +0000
commit418a2bbe9796007cfed5e00f26b757a9dd48d0bc (patch)
tree71fc1f2a912ec4b7ef65e2eb96f51e6a4ba92aa5 /gcc/cp/call.c
parent40bf2bd4f795b68e617a3ce464c7fe2960eb0021 (diff)
downloadppe42-gcc-418a2bbe9796007cfed5e00f26b757a9dd48d0bc.tar.gz
ppe42-gcc-418a2bbe9796007cfed5e00f26b757a9dd48d0bc.zip
* call.c (build_new_method_call): Also check destructors.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31157 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r--gcc/cp/call.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index fd5cfeecb35..596cc325309 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -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))
{
OpenPOWER on IntegriCloud