diff options
author | Jason Merrill <jason@redhat.com> | 2023-04-14 13:37:16 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2023-04-14 21:34:14 -0400 |
commit | 9964df74a9e99e850bf9b0b6ff5c47133f846db8 (patch) | |
tree | 44bb6e88aecdd16b93b79a03cdc89149e5aaf76f /gcc/ada/gcc-interface/decl.cc | |
parent | 1aee19f9b57caef2a600968807ecaa13bac2d2f8 (diff) | |
download | gcc-9964df74a9e99e850bf9b0b6ff5c47133f846db8.zip gcc-9964df74a9e99e850bf9b0b6ff5c47133f846db8.tar.gz gcc-9964df74a9e99e850bf9b0b6ff5c47133f846db8.tar.bz2 |
-Wdangling-pointer: fix MEM_REF handling [PR109514]
Here we hit the MEM_REF case, with its arg an ADDR_EXPR, but had no handling
for that and wrongly assumed it would be a reference to a local variable.
This patch overhauls the logic for deciding whether the target is something
to warn about so that we only warn if we specifically recognize the target
as non-local. None of the existing tests regress as a result.
PR c++/109514
gcc/ChangeLog:
* gimple-ssa-warn-access.cc (pass_waccess::check_dangling_stores):
Overhaul lhs_ref.ref analysis.
gcc/testsuite/ChangeLog:
* g++.dg/warn/Wdangling-pointer-6.C: New test.
Diffstat (limited to 'gcc/ada/gcc-interface/decl.cc')
0 files changed, 0 insertions, 0 deletions