mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-18 08:50:28 +08:00
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 <jakub@redhat.com> * 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.
This commit is contained in:
parent
eb5ee64648
commit
3e0b19f1d6
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user