From 7f477e818acc433475aba2521fce584dd8794715 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Thu, 29 Apr 1999 08:33:55 +0000 Subject: cp-tree.h (TYPE_NOTHROW_P): New macro. * cp-tree.h (TYPE_NOTHROW_P): New macro. * decl2.c (delete_sanity): Warn on deleting void *. * init.c (build_new_1): Use TYPE_NOTHROW_P. * typeck.c (c_expand_return): cp_pedwarn on returning NULL from throwing operator new. From-SVN: r26692 --- gcc/cp/cp-tree.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gcc/cp/cp-tree.h') diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index eb0411c..209d95b 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -1130,6 +1130,11 @@ struct lang_type equivalently, no throw specification. */ #define TYPE_RAISES_EXCEPTIONS(NODE) TYPE_NONCOPIED_PARTS (NODE) +/* For FUNCTION_TYPE or METHOD_TYPE, return 1 iff it is declared `throw()'. */ +#define TYPE_NOTHROW_P(NODE) \ + (TYPE_RAISES_EXCEPTIONS (NODE) \ + && TREE_VALUE (TYPE_RAISES_EXCEPTIONS (NODE)) == NULL_TREE) + /* The binding level associated with the namespace. */ #define NAMESPACE_LEVEL(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.level) -- cgit v1.1