diff options
author | Mark Mitchell <mark@codesourcery.com> | 2000-05-04 14:54:18 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2000-05-04 14:54:18 +0000 |
commit | 872f37f91215eb7e737c4e7662aa829e6032be60 (patch) | |
tree | afa1bd1d9dfc8d268635e08179700f055b9f48cb /gcc/cp/tree.c | |
parent | 72b9c7fb371a69f8430e70beb466911694de669b (diff) | |
download | gcc-872f37f91215eb7e737c4e7662aa829e6032be60.zip gcc-872f37f91215eb7e737c4e7662aa829e6032be60.tar.gz gcc-872f37f91215eb7e737c4e7662aa829e6032be60.tar.bz2 |
cp-tree.h (special_function_kind): Add various kinds of destructors.
* cp-tree.h (special_function_kind): Add various kinds of
destructors.
(special_function_p): New function.
* class.c (overrides): Don't let one kind of destructor override
another.
* decl2.c (mark_used): Use DECL_NON_THUNK_FUNCTION_P when deciding
whether or not to instantiate a template.
* tree.c (special_function_p): Define.
From-SVN: r33668
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r-- | gcc/cp/tree.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index c3bdb1d..712e40d 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -2413,3 +2413,34 @@ cp_unsave (tp) /* Clean up. */ splay_tree_delete (st); } + +/* Returns the kind of special function that DECL (a FUNCTION_DECL) + is. Note that this sfk_none is zero, so this function can be used + as a predicate to test whether or not DECL is a special function. */ + +special_function_kind +special_function_p (decl) + tree decl; +{ + /* Rather than doing all this stuff with magic names, we should + probably have a field of type `special_function_kind' in + DECL_LANG_SPECIFIC. */ + if (DECL_COPY_CONSTRUCTOR_P (decl)) + return sfk_copy_constructor; + if (DECL_CONSTRUCTOR_P (decl)) + return sfk_constructor; + if (DECL_NAME (decl) == ansi_opname[(int) MODIFY_EXPR]) + return sfk_assignment_operator; + if (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (decl)) + return sfk_destructor; + if (DECL_COMPLETE_DESTRUCTOR_P (decl)) + return sfk_complete_destructor; + if (DECL_BASE_DESTRUCTOR_P (decl)) + return sfk_base_destructor; + if (DECL_DELETING_DESTRUCTOR_P (decl)) + return sfk_deleting_destructor; + if (DECL_CONV_FN_P (decl)) + return sfk_conversion; + + return sfk_none; +} |