diff options
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r-- | gcc/cp/call.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c index b7aa97c..894f98e 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -7881,6 +7881,7 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain) nonnull are disabled. Just in case that at least one of them is active the check_function_arguments function might warn about something. */ + bool warned_p = false; if (warn_nonnull || warn_format || warn_suggest_attribute_format) { tree *fargs = (!nargs ? argarray @@ -7888,7 +7889,8 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain) for (j = 0; j < nargs; j++) fargs[j] = maybe_constant_value (argarray[j]); - check_function_arguments (input_location, TREE_TYPE (fn), nargs, fargs); + warned_p = check_function_arguments (input_location, TREE_TYPE (fn), + nargs, fargs); } if (DECL_INHERITED_CTOR (fn)) @@ -8107,6 +8109,12 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain) /* build_new_op_1 will clear this when appropriate. */ CALL_EXPR_ORDERED_ARGS (c) = true; } + if (warned_p) + { + tree c = extract_call_expr (call); + if (TREE_CODE (c) == CALL_EXPR) + TREE_NO_WARNING (c) = 1; + } return call; } |