]> git.ipfire.org Git - thirdparty/gcc.git/commit
Correct -Warray-bounds handling if function pointers [PR101601].
authorMartin Sebor <msebor@redhat.com>
Wed, 28 Jul 2021 22:14:38 +0000 (16:14 -0600)
committerMartin Sebor <msebor@redhat.com>
Wed, 28 Jul 2021 22:14:38 +0000 (16:14 -0600)
commitb9cbf8c9e0bc72f59b643165247fae646560aadd
treeba826defe0728c66693746d587fa5e933ffc928e
parent2a837de28ee94b4ec201059a9a7aaa852e6808da
Correct -Warray-bounds handling if function pointers [PR101601].

Resolves:
PR middle-end/101601 - -Warray-bounds triggers error: arrays of functions are not meaningful

PR middle-end/101601

gcc/ChangeLog:

* gimple-array-bounds.cc (array_bounds_checker::check_mem_ref): Remove
a pointless test.
Handle pointers to functions.

gcc/testsuite/ChangeLog:

* g++.dg/warn/Warray-bounds-25.C: New test.
* gcc.dg/Warray-bounds-85.c: New test.
gcc/gimple-array-bounds.cc
gcc/testsuite/g++.dg/warn/Warray-bounds-25.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/Warray-bounds-85.c [new file with mode: 0644]