From: Jakub Jelinek Date: Fri, 21 Jan 2022 10:18:45 +0000 (+0100) Subject: warn-access: Fix up warning_at arguments X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3e0b19f1d670aa37ac06d63d059c7277ae1188d8;p=test_jj.git warn-access: Fix up warning_at arguments A warning regression fix I'm about to post warns (and breaks bootstrap due to that) on the following spot. Seems it is a copy and paste from earlier code that mentions the %qD variable instead of talking about unnamed temporary. 2022-01-21 Jakub Jelinek * gimple-ssa-warn-access.cc (pass_waccess::warn_invalid_pointer): Avoid passing var to warning_at when the format string doesn't refer to it. --- diff --git a/gcc/gimple-ssa-warn-access.cc b/gcc/gimple-ssa-warn-access.cc index c36cd5d..8bc33ee 100644 --- a/gcc/gimple-ssa-warn-access.cc +++ b/gcc/gimple-ssa-warn-access.cc @@ -3953,15 +3953,14 @@ pass_waccess::warn_invalid_pointer (tree ref, gimple *use_stmt, "may be used") : G_("using dangling pointer %qE to an unnamed " "temporary")), - ref, var)) + ref)) || (!ref && warning_at (use_loc, OPT_Wdangling_pointer_, (maybe ? G_("dangling pointer to an unnamed temporary " "may be used") : G_("using a dangling pointer to an unnamed " - "temporary")), - var))) + "temporary"))))) { inform (DECL_SOURCE_LOCATION (var), "unnamed temporary defined here");