diff options
author | Martin v. Löwis <loewis@informatik.hu-berlin.de> | 2000-01-01 13:29:44 +0000 |
---|---|---|
committer | Martin v. Löwis <loewis@gcc.gnu.org> | 2000-01-01 13:29:44 +0000 |
commit | 1cb47a5cab576fa5725eb857bf801a006a19571a (patch) | |
tree | 71fc1f2a912ec4b7ef65e2eb96f51e6a4ba92aa5 /gcc | |
parent | 3bdf58486dbd0f79546c871c118d6f218516db71 (diff) | |
download | gcc-1cb47a5cab576fa5725eb857bf801a006a19571a.zip gcc-1cb47a5cab576fa5725eb857bf801a006a19571a.tar.gz gcc-1cb47a5cab576fa5725eb857bf801a006a19571a.tar.bz2 |
* call.c (build_new_method_call): Also check destructors.
From-SVN: r31157
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/call.c | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3fb56b0..630a1fa 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index fd5cfee..596cc32 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)) { |