Tighten 'dg-warning' alternatives in 'c-c++-common/Wfree-nonheap-object{,-2,-3}.c'
commit9c03391ba447ff86038d6a34c90ae737c3915b5f
authorThomas Schwinge <thomas@codesourcery.com>
Wed, 7 Jun 2023 14:24:26 +0000 (7 16:24 +0200)
committerThomas Schwinge <thomas@codesourcery.com>
Wed, 14 Jun 2023 09:41:44 +0000 (14 11:41 +0200)
tree17809be470aafd28661c3f896a4e3efd57073461
parent460ad9b90502e21631d015d3d6e324ba04e3eb09
Tighten 'dg-warning' alternatives in 'c-c++-common/Wfree-nonheap-object{,-2,-3}.c'

..., added in commit fe7f75cf16783589eedbab597e6d0b8d35d7e470
"Correct/improve maybe_emit_free_warning (PR middle-end/98166, PR c++/57111, PR middle-end/98160)".

These use alternatives like, for example, "AB|CDE|FG", but what really must've
been meant is "A(B|C)D(E|F)G".  The former variant also does "work": it matches
any of "AB", or "CDE", or "FG", which are components of the latter variant.
(That means, the former variant matches too loosely.)

gcc/testsuite/
* c-c++-common/Wfree-nonheap-object-2.c: Tighten 'dg-warning'
alternatives.
* c-c++-common/Wfree-nonheap-object-3.c: Likewise.
* c-c++-common/Wfree-nonheap-object.c: Likewise.
gcc/testsuite/c-c++-common/Wfree-nonheap-object-2.c
gcc/testsuite/c-c++-common/Wfree-nonheap-object-3.c
gcc/testsuite/c-c++-common/Wfree-nonheap-object.c