diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2024-06-29 22:42:43 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2024-06-30 15:43:58 -0700 |
commit | adf584eb92b0aaf134db99f4238eedb3e5bacb4a (patch) | |
tree | d9a4e745647849f789b14137ffcb0573c95b989e /bfd/version.h | |
parent | ebe3f6d0f18505e3f6a1800d3a3ee4b3403d726f (diff) | |
download | gdb-adf584eb92b0aaf134db99f4238eedb3e5bacb4a.zip gdb-adf584eb92b0aaf134db99f4238eedb3e5bacb4a.tar.gz gdb-adf584eb92b0aaf134db99f4238eedb3e5bacb4a.tar.bz2 |
ld: Avoid folding new and delete pairs
GCC 15 may fold new and delete pairs, like
A *bb = new A[10];
delete [] bb;
bb = new (std::nothrow) A [10];
delete [] bb;
as shown in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115712
Avoid folding new and delete pairs by adding a function call between new
and delete.
* testsuite/ld-elf/dl5.cc: Include "dl5.h".
(A): Removed.
Call foo between new and delete.
* testsuite/ld-elf/dl5.h: New file.
* testsuite/ld-elf/new.cc: Include "dl5.h".
(foo): New function.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Diffstat (limited to 'bfd/version.h')
0 files changed, 0 insertions, 0 deletions