aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/cp-tree.h
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>1999-04-29 08:33:55 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>1999-04-29 08:33:55 +0000
commit7f477e818acc433475aba2521fce584dd8794715 (patch)
tree2d18cbe3b572fdba5fae9997a0e9974a51d342c0 /gcc/cp/cp-tree.h
parent9939c435d293b687481de7fb0d2d95d077b3e168 (diff)
downloadgcc-7f477e818acc433475aba2521fce584dd8794715.zip
gcc-7f477e818acc433475aba2521fce584dd8794715.tar.gz
gcc-7f477e818acc433475aba2521fce584dd8794715.tar.bz2
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
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r--gcc/cp/cp-tree.h5
1 files changed, 5 insertions, 0 deletions
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)