diff options
Diffstat (limited to 'gcc/cp/typeck.c')
-rw-r--r-- | gcc/cp/typeck.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index a7dc418..3cc746a 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -9073,8 +9073,10 @@ check_return_expr (tree retval, bool *no_warning) } /* Only operator new(...) throw(), can return NULL [expr.new/13]. */ - if ((DECL_OVERLOADED_OPERATOR_P (current_function_decl) == NEW_EXPR - || DECL_OVERLOADED_OPERATOR_P (current_function_decl) == VEC_NEW_EXPR) + if (DECL_OVERLOADED_OPERATOR_P (current_function_decl) + && (DECL_OVERLOADED_OPERATOR_CODE (current_function_decl) == NEW_EXPR + || (DECL_OVERLOADED_OPERATOR_CODE (current_function_decl) + == VEC_NEW_EXPR)) && !TYPE_NOTHROW_P (TREE_TYPE (current_function_decl)) && ! flag_check_new && retval && null_ptr_cst_p (retval)) @@ -9083,7 +9085,7 @@ check_return_expr (tree retval, bool *no_warning) /* Effective C++ rule 15. See also start_function. */ if (warn_ecpp - && DECL_NAME (current_function_decl) == cp_assignment_operator_id (NOP_EXPR)) + && DECL_NAME (current_function_decl) == assign_op_identifier) { bool warn = true; |