{
/* Avoid copying empty classes. */
val = build2 (COMPOUND_EXPR, type, arg, to);
- TREE_NO_WARNING (val) = 1;
+ suppress_warning (val, OPT_Wunused);
}
else if (tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (as_base)))
{
build2 (MEM_REF, array_type, arg0, alias_set),
build2 (MEM_REF, array_type, arg, alias_set));
val = build2 (COMPOUND_EXPR, TREE_TYPE (to), t, to);
- TREE_NO_WARNING (val) = 1;
+ suppress_warning (val, OPT_Wunused);
}
cp_warn_deprecated_use (fn, complain);
{
tree c = extract_call_expr (call);
if (TREE_CODE (c) == CALL_EXPR)
- TREE_NO_WARNING (c) = 1;
+ suppress_warning (c /* Suppress all warnings. */);
}
if (TREE_CODE (fn) == ADDR_EXPR)
{
TREE_ADDRESSABLE (var) = 1;
if (TREE_CODE (decl) == FIELD_DECL
- && extra_warnings && !TREE_NO_WARNING (decl))
+ && extra_warnings && !warning_suppressed_p (decl))
{
warning (OPT_Wextra, "a temporary bound to %qD only persists "
"until the constructor exits", decl);
- TREE_NO_WARNING (decl) = true;
+ suppress_warning (decl);
}
/* Recursively extend temps in this initializer. */
laying out an Objective-C class. The ObjC ABI differs
from the C++ ABI, and so we do not want a warning
here. */
- && !TREE_NO_WARNING (field)
+ && !warning_suppressed_p (field, OPT_Wabi)
&& !last_field_was_bitfield
&& !integer_zerop (size_binop (TRUNC_MOD_EXPR,
DECL_FIELD_BIT_OFFSET (field),
else
r = satisfy_nondeclaration_constraints (t, args, info);
if (r == error_mark_node && info.quiet ()
- && !(DECL_P (t) && TREE_NO_WARNING (t)))
+ && !(DECL_P (t) && warning_suppressed_p (t)))
{
/* Replay the error noisily. */
sat_info noisy (tf_warning_or_error, info.in_decl);
constraint_satisfaction_value (t, args, noisy);
if (DECL_P (t) && !args)
/* Avoid giving these errors again. */
- TREE_NO_WARNING (t) = true;
+ suppress_warning (t);
}
return r;
}
is declared to return non-void (most likely). This is correct - we
synthesize the return for the ramp in the compiler. So suppress any
extraneous warnings during substitution. */
- TREE_NO_WARNING (current_function_decl) = true;
+ suppress_warning (current_function_decl, OPT_Wreturn_type);
/* If we don't know the promise type, we can't proceed, build the
co_await with the expression unchanged. */
is declared to return non-void (most likely). This is correct - we
synthesize the return for the ramp in the compiler. So suppress any
extraneous warnings during substitution. */
- TREE_NO_WARNING (current_function_decl) = true;
+ suppress_warning (current_function_decl, OPT_Wreturn_type);
/* If we don't know the promise type, we can't proceed, build the
co_await with the expression unchanged. */
is declared to return non-void (most likely). This is correct - we
synthesize the return for the ramp in the compiler. So suppress any
extraneous warnings during substitution. */
- TREE_NO_WARNING (current_function_decl) = true;
+ suppress_warning (current_function_decl, OPT_Wreturn_type);
if (processing_template_decl
&& check_for_bare_parameter_packs (expr))
/* Suppress -Wreturn-type for co_return, we need to check indirectly
whether the promise type has a suitable return_void/return_value. */
- TREE_NO_WARNING (current_function_decl) = true;
+ suppress_warning (current_function_decl, OPT_Wreturn_type);
if (!processing_template_decl && warn_sequence_point)
verify_sequence_points (expr);
/* done. */
r = build_stmt (loc, RETURN_EXPR, NULL);
- TREE_NO_WARNING (r) |= 1; /* We don't want a warning about this. */
+ suppress_warning (r); /* We don't want a warning about this. */
r = maybe_cleanup_point_expr_void (r);
add_stmt (r);
add_stmt (r);
r = build_stmt (loc, RETURN_EXPR, NULL);
- TREE_NO_WARNING (r) |= 1; /* We don't want a warning about this. */
+ suppress_warning (r); /* We don't want a warning about this. */
r = maybe_cleanup_point_expr_void (r);
add_stmt (r);
finish_if_stmt_cond (not_iarc, not_iarc_if);
/* If the initial await resume called value is false, rethrow... */
tree rethrow = build_throw (fn_start, NULL_TREE);
- TREE_NO_WARNING (rethrow) = true;
+ suppress_warning (rethrow);
finish_expr_stmt (rethrow);
finish_then_clause (not_iarc_if);
tree iarc_scope = IF_SCOPE (not_iarc_if);
/* For early errors, we do not want a diagnostic about the missing
ramp return value, since the user cannot fix this - a 'return' is
not allowed in a coroutine. */
- TREE_NO_WARNING (orig) = true;
+ suppress_warning (orig, OPT_Wreturn_type);
/* Discard the body, we can't process it further. */
pop_stmt_list (DECL_SAVED_TREE (orig));
DECL_SAVED_TREE (orig) = push_stmt_list ();
DECL_SAVED_TREE (orig) = push_stmt_list ();
append_to_statement_list (fnbody, &DECL_SAVED_TREE (orig));
/* Suppress warnings about the missing return value. */
- TREE_NO_WARNING (orig) = true;
+ suppress_warning (orig, OPT_Wreturn_type);
return false;
}
BIND_EXPR_BODY (ramp_bind) = pop_stmt_list (ramp_body);
DECL_SAVED_TREE (orig) = newbody;
/* Suppress warnings about the missing return value. */
- TREE_NO_WARNING (orig) = true;
+ suppress_warning (orig, OPT_Wreturn_type);
return false;
}
promise_type, fn_start);
finish_expr_stmt (del_coro_fr);
tree rethrow = build_throw (fn_start, NULL_TREE);
- TREE_NO_WARNING (rethrow) = true;
+ suppress_warning (rethrow);
finish_expr_stmt (rethrow);
finish_handler (handler);
TRY_HANDLERS (ramp_cleanup) = pop_stmt_list (TRY_HANDLERS (ramp_cleanup));
tree failure = build_call_n (call_unexpected_fn, 1, build_exc_ptr ());
*stmt_p = build_gimple_eh_filter_tree (body, allowed, failure);
- TREE_NO_WARNING (*stmt_p) = true;
- TREE_NO_WARNING (TREE_OPERAND (*stmt_p, 1)) = true;
+ suppress_warning (*stmt_p);
+ suppress_warning (TREE_OPERAND (*stmt_p, 1));
}
/* Return the first non-compound statement in STMT. */
{
if (!IS_EMPTY_STMT (stmt)
&& !VOID_TYPE_P (TREE_TYPE (stmt))
- && !TREE_NO_WARNING (stmt))
+ && !warning_suppressed_p (stmt, OPT_Wunused_value))
warning (OPT_Wunused_value, "statement with no effect");
}
else
case THROW_EXPR:
{
location_t loc = location_of (stmt);
- if (TREE_NO_WARNING (stmt))
+ if (warning_suppressed_p (stmt /* What warning? */))
/* Never mind. */;
else if (wtd->try_block)
{
;
else if (COMPARISON_CLASS_P (x))
{
- if (TREE_NO_WARNING (org_x) && warn_nonnull_compare)
- TREE_NO_WARNING (x) = 1;
+ if (warn_nonnull_compare
+ && warning_suppressed_p (org_x, OPT_Wnonnull_compare))
+ suppress_warning (x, OPT_Wnonnull_compare);
}
/* Otherwise give up on optimizing these, let GIMPLE folders
optimize those later on. */
|| op1 != TREE_OPERAND (org_x, 1))
{
x = build2_loc (loc, code, TREE_TYPE (org_x), op0, op1);
- if (TREE_NO_WARNING (org_x) && warn_nonnull_compare)
- TREE_NO_WARNING (x) = 1;
+ if (warn_nonnull_compare
+ && warning_suppressed_p (org_x, OPT_Wnonnull_compare))
+ suppress_warning (x, OPT_Wnonnull_compare);
}
else
x = org_x;
if (EXPR_P (x) && TREE_CODE (x) == code)
{
TREE_THIS_VOLATILE (x) = TREE_THIS_VOLATILE (org_x);
- TREE_NO_WARNING (x) = TREE_NO_WARNING (org_x);
+ copy_warning (x, org_x);
}
if (!c.evaluation_restricted_p ())
build_zero_cst (TREE_TYPE (op)));
/* This is a compiler generated comparison, don't emit
e.g. -Wnonnull-compare warning for it. */
- TREE_NO_WARNING (cond) = 1;
+ suppress_warning (cond, OPT_Wnonnull_compare);
vptr = build3_loc (loc, COND_EXPR, uint64_type_node, cond,
vptr, build_int_cst (uint64_type_node, 0));
}
tree
cp_fold_convert (tree type, tree expr)
{
- bool nowarn = TREE_NO_WARNING (expr);
-
tree conv;
if (TREE_TYPE (expr) == type)
conv = expr;
conv = ignore_overflows (conv, expr);
}
- if (nowarn && TREE_CODE (expr) == TREE_CODE (conv))
- TREE_NO_WARNING (conv) = nowarn;
+ if (TREE_CODE (expr) == TREE_CODE (conv))
+ copy_warning (conv, expr);
return conv;
}
/* The second part of a compound expr contains the value. */
tree op1 = TREE_OPERAND (expr,1);
tree new_op1;
- if (implicit != ICV_CAST && !TREE_NO_WARNING (expr))
+ if (implicit != ICV_CAST && !warning_suppressed_p (expr /* What warning? */))
new_op1 = convert_to_void (op1, ICV_RIGHT_OF_COMMA, complain);
else
new_op1 = convert_to_void (op1, ICV_CAST, complain);
if (warn_unused_value
&& implicit != ICV_CAST
&& (complain & tf_warning)
- && !TREE_NO_WARNING (expr)
+ && !warning_suppressed_p (expr, OPT_Wunused_value)
&& !is_reference)
warning_at (loc, OPT_Wunused_value, "value computed is not used");
expr = TREE_OPERAND (expr, 0);
{
if (implicit != ICV_CAST
&& warn_unused_value
- && !TREE_NO_WARNING (expr)
+ && !warning_suppressed_p (expr, OPT_Wunused_value)
&& !processing_template_decl
&& !cp_unevaluated_operand
&& (complain & tf_warning))
&& !TREE_PUBLIC (decl)
&& !DECL_ARTIFICIAL (decl)
&& !DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (decl)
- && !TREE_NO_WARNING (decl))
+ && !warning_suppressed_p (decl, OPT_Wunused_function))
warning_at (DECL_SOURCE_LOCATION (decl),
OPT_Wunused_function,
"%qF declared %<static%> but never defined", decl);
decl = build_decl (id_loc, FIELD_DECL, unqualified_id, type);
DECL_NONADDRESSABLE_P (decl) = bitfield;
if (bitfield && !unqualified_id)
- {
- TREE_NO_WARNING (decl) = 1;
- DECL_PADDING_P (decl) = 1;
- }
+ DECL_PADDING_P (decl) = 1;
if (storage_class == sc_mutable)
{
/* Don't complain if we are declared noreturn. */
&& !TREE_THIS_VOLATILE (fndecl)
&& !DECL_NAME (DECL_RESULT (fndecl))
- && !TREE_NO_WARNING (fndecl)
+ && !warning_suppressed_p (fndecl, OPT_Wreturn_type)
/* Structor return values (if any) are set by the compiler. */
&& !DECL_CONSTRUCTOR_P (fndecl)
&& !DECL_DESTRUCTOR_P (fndecl)
else if (warning_at (&richloc, OPT_Wreturn_type,
"no return statement in function returning "
"non-void"))
- TREE_NO_WARNING (fndecl) = 1;
+ suppress_warning (fndecl, OPT_Wreturn_type);
}
/* Lambda closure members are implicitly constexpr if possible. */
&& !DECL_READ_P (decl)
&& DECL_NAME (decl)
&& !DECL_ARTIFICIAL (decl)
- && !TREE_NO_WARNING (decl)
+ && !warning_suppressed_p (decl,OPT_Wunused_but_set_parameter)
&& !DECL_IN_SYSTEM_HEADER (decl)
&& TREE_TYPE (decl) != error_mark_node
&& !TYPE_REF_P (TREE_TYPE (decl))
{
if (undeduced_auto_decl (decl))
{
- if (TREE_NO_WARNING (decl) && seen_error ())
+ if (warning_suppressed_p (decl) && seen_error ())
/* We probably already complained about deduction failure. */;
else if (complain & tf_error)
error ("use of %qD before deduction of %<auto%>", decl);
|| (errorcount + sorrycount > 0
&& DECL_LANG_SPECIFIC (decl)
&& DECL_TEMPLATE_INFO (decl)
- && TREE_NO_WARNING (decl))))
+ && warning_suppressed_p (decl /* What warning? */))))
/* In C++11 it's ok if the decl is defined. */
return;
&& warning_at (DECL_SOURCE_LOCATION (decl), 0,
"inline function %qD used but never defined", decl))
/* Avoid a duplicate warning from check_global_declaration. */
- TREE_NO_WARNING (decl) = 1;
+ suppress_warning (decl, OPT_Wunused);
}
/* So must decls that use a type with no linkage. */
|| DECL_DESTRUCTOR_P (current_function_decl)))
{
tree rethrow = build_throw (input_location, NULL_TREE);
- TREE_NO_WARNING (rethrow) = true;
+ /* Disable all warnings for the generated rethrow statement. */
+ suppress_warning (rethrow);
finish_expr_stmt (rethrow);
}
}
the arguments to the constructor call. */
{
/* CLEANUP is compiler-generated, so no diagnostics. */
- TREE_NO_WARNING (cleanup) = true;
+ suppress_warning (cleanup);
init_expr = build2 (TRY_CATCH_EXPR, void_type_node,
init_expr, cleanup);
/* Likewise, this try-catch is compiler-generated. */
- TREE_NO_WARNING (init_expr) = true;
+ suppress_warning (init_expr);
}
else
/* Ack! First we allocate the memory. Then we set our sentry
sentry = TARGET_EXPR_SLOT (begin);
/* CLEANUP is compiler-generated, so no diagnostics. */
- TREE_NO_WARNING (cleanup) = true;
+ suppress_warning (cleanup);
TARGET_EXPR_CLEANUP (begin)
= build3 (COND_EXPR, void_type_node, sentry,
build2 (COMPOUND_EXPR, void_type_node, init_expr,
end));
/* Likewise, this is compiler-generated. */
- TREE_NO_WARNING (init_expr) = true;
+ suppress_warning (init_expr);
}
}
}
/* Wrap it in a NOP_EXPR so warn_if_unused_value doesn't complain. */
rval = build1_loc (loc, NOP_EXPR, TREE_TYPE (rval), rval);
- TREE_NO_WARNING (rval) = 1;
+ suppress_warning (rval, OPT_Wunused_value);
return rval;
}
fold_convert (TREE_TYPE (base), nullptr_node));
/* This is a compiler generated comparison, don't emit
e.g. -Wnonnull-compare warning for it. */
- TREE_NO_WARNING (cond) = 1;
+ suppress_warning (cond, OPT_Wnonnull_compare);
body = build3_loc (loc, COND_EXPR, void_type_node,
cond, body, integer_zero_node);
COND_EXPR_IS_VEC_DELETE (body) = true;
atype = build_pointer_type (atype);
stmt_expr = build1 (NOP_EXPR, atype, stmt_expr);
stmt_expr = cp_build_fold_indirect_ref (stmt_expr);
- TREE_NO_WARNING (stmt_expr) = 1;
+ suppress_warning (stmt_expr /* What warning? */);
}
return stmt_expr;
/* This is a compiler generated comparison, don't emit
e.g. -Wnonnull-compare warning for it. */
else if (TREE_CODE (ifexp) == NE_EXPR)
- TREE_NO_WARNING (ifexp) = 1;
+ suppress_warning (ifexp, OPT_Wnonnull_compare);
if (!integer_nonzerop (ifexp))
expr = build3 (COND_EXPR, void_type_node, ifexp, expr, void_node);
/* Avoid do_warn_unused_parameter warnings. */
for (tree p = FUNCTION_FIRST_USER_PARM (fn); p; p = DECL_CHAIN (p))
if (DECL_NAME (p))
- TREE_NO_WARNING (p) = 1;
+ suppress_warning (p, OPT_Wunused_parameter);
if (current_class_type && TYPE_BEING_DEFINED (current_class_type))
/* Defer checking. */;
+
/* -*- C++ -*- Parser.
Copyright (C) 2000-2021 Free Software Foundation, Inc.
Written by Mark Mitchell <mark@codesourcery.com>.
/* The operands of a fold-expression are cast-expressions, so binary or
conditional expressions are not allowed. We check this here to avoid
tentative parsing. */
- if (EXPR_P (expr1) && TREE_NO_WARNING (expr1))
+ if (EXPR_P (expr1) && warning_suppressed_p (expr1, OPT_Wparentheses))
/* OK, the expression was parenthesized. */;
else if (is_binary_op (TREE_CODE (expr1)))
error_at (location_of (expr1),
/* Consume the `)'. */
token = cp_lexer_peek_token (parser->lexer);
location_t close_paren_loc = token->location;
+ bool no_wparens = warning_suppressed_p (expr, OPT_Wparentheses);
expr.set_range (open_paren_loc, close_paren_loc);
+ if (no_wparens)
+ suppress_warning (expr, OPT_Wparentheses);
if (!parens.require_close (parser)
&& !cp_parser_uncommitted_to_tentative_parse_p (parser))
cp_parser_skip_to_end_of_statement (parser);
constant expressions. */
if (!targs && limit_bad_template_recursion (tldcl))
{
- /* Avoid no_linkage_errors and unused function warnings for this
- decl. */
- TREE_NO_WARNING (tldcl) = 1;
+ /* Avoid no_linkage_errors and unused function (and all other)
+ warnings for this decl. */
+ suppress_warning (tldcl);
return false;
}
tree op1 = tsubst_copy (TREE_OPERAND (t, 1), args, complain, in_decl);
tree op2 = tsubst_copy (TREE_OPERAND (t, 2), args, complain, in_decl);
r = build_nt (code, op0, op1, op2);
- TREE_NO_WARNING (r) = TREE_NO_WARNING (t);
+ copy_warning (r, t);
return r;
}
block = finish_omp_structured_block (block);
block = maybe_cleanup_point_expr_void (block);
add_decl_expr (omp_out);
- if (TREE_NO_WARNING (DECL_EXPR_DECL (stmts[0])))
- TREE_NO_WARNING (omp_out) = 1;
+ copy_warning (omp_out, DECL_EXPR_DECL (stmts[0]));
add_decl_expr (omp_in);
finish_expr_stmt (block);
}
tree r = build_x_binary_op
(input_location, TREE_CODE (t),
op0,
- (TREE_NO_WARNING (TREE_OPERAND (t, 0))
+ (warning_suppressed_p (TREE_OPERAND (t, 0))
? ERROR_MARK
: TREE_CODE (TREE_OPERAND (t, 0))),
op1,
- (TREE_NO_WARNING (TREE_OPERAND (t, 1))
+ (warning_suppressed_p (TREE_OPERAND (t, 1))
? ERROR_MARK
: TREE_CODE (TREE_OPERAND (t, 1))),
/*overload=*/NULL,
complain|decltype_flag);
- if (EXPR_P (r) && TREE_NO_WARNING (t))
- TREE_NO_WARNING (r) = TREE_NO_WARNING (t);
+ if (EXPR_P (r))
+ copy_warning (r, t);
RETURN (r);
}
set and must be copied. In the latter case,
build_x_modify_expr sets it and it must not be reset
here. */
- if (TREE_NO_WARNING (t))
- TREE_NO_WARNING (r) = TREE_NO_WARNING (t);
+ if (warning_suppressed_p (t, OPT_Wparentheses))
+ suppress_warning (r, OPT_Wparentheses);
RETURN (r);
}
/* This is a compiler generated comparison, don't emit
e.g. -Wnonnull-compare warning for it. */
- TREE_NO_WARNING (cond) = 1;
+ suppress_warning (cond, OPT_Wnonnull);
null_ptr = cp_convert (TREE_TYPE (result), nullptr_node, complain);
cond = build3 (COND_EXPR, TREE_TYPE (result), cond, result, null_ptr);
/* Likewise, don't emit -Wnonnull for using the result to call
a member function. */
- TREE_NO_WARNING (cond) = 1;
+ suppress_warning (cond, OPT_Wnonnull);
return cond;
}
cond = convert_from_reference (cond);
if (TREE_CODE (cond) == MODIFY_EXPR
- && !TREE_NO_WARNING (cond)
&& warn_parentheses
+ && !warning_suppressed_p (cond, OPT_Wparentheses)
&& warning_at (cp_expr_loc_or_input_loc (cond),
OPT_Wparentheses, "suggest parentheses around "
"assignment used as truth value"))
- TREE_NO_WARNING (cond) = 1;
+ suppress_warning (cond, OPT_Wparentheses);
return condition_conversion (cond);
}
{
/* Suppress -Wreturn-type for this function. */
if (warn_return_type)
- TREE_NO_WARNING (current_function_decl) = true;
+ suppress_warning (current_function_decl, OPT_Wreturn_type);
return error_mark_node;
}
}
r = build_stmt (input_location, RETURN_EXPR, expr);
- TREE_NO_WARNING (r) |= no_warning;
+ if (no_warning)
+ suppress_warning (r, OPT_Wreturn_type);
r = maybe_cleanup_point_expr_void (r);
r = add_stmt (r);
{
if (EXPR_P (expr))
/* This inhibits warnings in c_common_truthvalue_conversion. */
- TREE_NO_WARNING (expr) = 1;
+ suppress_warning (expr, OPT_Wparentheses);
if (TREE_CODE (expr) == OFFSET_REF
|| TREE_CODE (expr) == SCOPE_REF)
{
gcc_assert (TREE_CODE (data.stmts[0]) == DECL_EXPR
&& TREE_CODE (data.stmts[1]) == DECL_EXPR);
- if (TREE_NO_WARNING (DECL_EXPR_DECL (data.stmts[0])))
+ if (warning_suppressed_p (DECL_EXPR_DECL (data.stmts[0]) /* What warning? */))
return true;
data.combiner_p = true;
if (cp_walk_tree (&data.stmts[2], cp_check_omp_declare_reduction_r,
&data, NULL))
- TREE_NO_WARNING (DECL_EXPR_DECL (data.stmts[0])) = 1;
+ suppress_warning (DECL_EXPR_DECL (data.stmts[0]) /* What warning? */);
}
if (i >= 6)
{
&data, NULL)
|| cp_walk_tree (&DECL_INITIAL (DECL_EXPR_DECL (data.stmts[3])),
cp_check_omp_declare_reduction_r, &data, NULL))
- TREE_NO_WARNING (DECL_EXPR_DECL (data.stmts[0])) = 1;
+ suppress_warning (DECL_EXPR_DECL (data.stmts[0]) /* Wat warning? */);
if (i == 7)
gcc_assert (TREE_CODE (data.stmts[6]) == DECL_EXPR);
}
/* Avoid spurious warnings with VLAs (c++/54583). */
if (TYPE_SIZE (t) && EXPR_P (TYPE_SIZE (t)))
- TREE_NO_WARNING (TYPE_SIZE (t)) = 1;
+ suppress_warning (TYPE_SIZE (t), OPT_Wunused);
/* Push these needs up to the ARRAY_TYPE so that initialization takes
place more easily. */
member = DECL_CHAIN (member))
if (DECL_NAME (member) == member_name)
break;
- tree res = build_simple_component_ref (ptrmem, member);
-
- TREE_NO_WARNING (res) = 1;
- return res;
+ return build_simple_component_ref (ptrmem, member);
}
/* Given an expression PTR for a pointer, return an expression
if (warn_strict_aliasing > 2
&& cp_strict_aliasing_warning (EXPR_LOCATION (ptr),
type, TREE_OPERAND (ptr, 0)))
- TREE_NO_WARNING (ptr) = 1;
+ suppress_warning (ptr, OPT_Wstrict_aliasing);
}
if (VOID_TYPE_P (t))
{
tree c = extract_call_expr (ret);
if (TREE_CODE (c) == CALL_EXPR)
- TREE_NO_WARNING (c) = 1;
+ suppress_warning (c, OPT_Wnonnull);
}
if (allocated != NULL)
if (!warn_address
|| (complain & tf_warning) == 0
|| c_inhibit_evaluation_warnings != 0
- || TREE_NO_WARNING (op))
+ || warning_suppressed_p (op, OPT_Waddress))
return;
tree cop = fold_for_warn (op);
if (TREE_CODE (cop) == ADDR_EXPR
&& decl_with_nonnull_addr_p (TREE_OPERAND (cop, 0))
- && !TREE_NO_WARNING (cop))
+ && !warning_suppressed_p (cop, OPT_Waddress))
warning_at (location, OPT_Waddress, "the address of %qD will never "
"be NULL", TREE_OPERAND (cop, 0));
else if (TREE_CODE (type0) == ARRAY_TYPE
&& !char_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (type0)))
/* Set by finish_parenthesized_expr. */
- && !TREE_NO_WARNING (op1)
+ && !warning_suppressed_p (op1, OPT_Wsizeof_array_div)
&& (complain & tf_warning))
maybe_warn_sizeof_array_div (location, first_arg, type0,
op1, non_reference (type1));
pfn0 = cp_fully_fold (pfn0);
/* Avoid -Waddress warnings (c++/64877). */
if (TREE_CODE (pfn0) == ADDR_EXPR)
- TREE_NO_WARNING (pfn0) = 1;
+ suppress_warning (pfn0, OPT_Waddress);
pfn1 = pfn_from_ptrmemfunc (op1);
pfn1 = cp_fully_fold (pfn1);
delta0 = delta_from_ptrmemfunc (op0);
tf_warning_or_error);
arg = build2 (COMPOUND_EXPR, TREE_TYPE (real_result),
arg, real_result);
- TREE_NO_WARNING (arg) = 1;
+ suppress_warning (arg /* What warning? */);
return arg;
}
TREE_SIDE_EFFECTS (result) = 1;
if (!plain_assign)
- TREE_NO_WARNING (result) = 1;
+ suppress_warning (result, OPT_Wparentheses);
ret:
if (preeval)
{
if (rval == error_mark_node)
return rval;
- TREE_NO_WARNING (rval) = 1;
+ suppress_warning (rval /* What warning? */);
if (processing_template_decl)
{
if (overload != NULL_TREE)
if (warn_parentheses
&& TREE_CODE (type) == BOOLEAN_TYPE
&& TREE_CODE (rhs) == MODIFY_EXPR
- && !TREE_NO_WARNING (rhs)
+ && !warning_suppressed_p (rhs, OPT_Wparentheses)
&& TREE_CODE (TREE_TYPE (rhs)) != BOOLEAN_TYPE
&& (complain & tf_warning)
&& warning_at (rhs_loc, OPT_Wparentheses,
"suggest parentheses around assignment used as "
"truth value"))
- TREE_NO_WARNING (rhs) = 1;
+ suppress_warning (rhs, OPT_Wparentheses);
if (complain & tf_warning)
warn_for_address_or_pointer_of_packed_member (type, rhs);