aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/typeck.c
diff options
context:
space:
mode:
authorPaolo Carlini <pcarlini@suse.de>2007-07-24 11:08:27 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2007-07-24 11:08:27 +0000
commitaedfac0ec957351085723e56204c4a54adaf089d (patch)
tree503acabc1c43a65ac6911adf51904ed5cf9e3a08 /gcc/cp/typeck.c
parent99c9c69acb9150b1b93bb86ec4ab0a65c8416c36 (diff)
downloadgcc-aedfac0ec957351085723e56204c4a54adaf089d.zip
gcc-aedfac0ec957351085723e56204c4a54adaf089d.tar.gz
gcc-aedfac0ec957351085723e56204c4a54adaf089d.tar.bz2
re PR c++/29001 (ICE on invalid return from operator new)
/cp 2007-07-24 Paolo Carlini <pcarlini@suse.de> PR c++/29001 * typeck.c (check_return_expr): Do not pass a null argument to null_ptr_cst_p. 2007-07-24 Paolo Carlini <pcarlini@suse.de> PR c++/32561 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P only on VAR_DECL. /testsuite 2007-07-24 Paolo Carlini <pcarlini@suse.de> PR c++/29001 * g++.dg/init/new22.C: New. 2007-07-24 Paolo Carlini <pcarlini@suse.de> PR c++/32561 * g++.dg/template/crash67.C: New. From-SVN: r126873
Diffstat (limited to 'gcc/cp/typeck.c')
-rw-r--r--gcc/cp/typeck.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 7a1a725..51deeb2 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -6639,7 +6639,7 @@ check_return_expr (tree retval, bool *no_warning)
|| DECL_OVERLOADED_OPERATOR_P (current_function_decl) == VEC_NEW_EXPR)
&& !TYPE_NOTHROW_P (TREE_TYPE (current_function_decl))
&& ! flag_check_new
- && null_ptr_cst_p (retval))
+ && retval && null_ptr_cst_p (retval))
warning (0, "%<operator new%> must not return NULL unless it is "
"declared %<throw()%> (or -fcheck-new is in effect)");