Fix "'operator new' should not return NULL" errors in testsuite
authorGary Benson <gbenson@redhat.com>
Thu, 28 May 2020 13:18:36 +0000 (14:18 +0100)
committerGary Benson <gbenson@redhat.com>
Thu, 28 May 2020 13:18:36 +0000 (14:18 +0100)
commitcee00f171520eb85867230d4cbed34480c64e71e
tree599a8b9d336040b1114d6e810cb978b6d0b2263a
parentefcf5fb585cdb6b7304a5a61a2d1e7db7d4bec6b
Fix "'operator new' should not return NULL" errors in testsuite

When running the testsuite with clang, gdb.linespec/cpls-ops.cc
fails to compile with the following errors:
  warning: 'operator new' should not return a null pointer unless
    it is declared 'throw()' or 'noexcept' [-Wnew-returns-null]
  warning: 'operator new[]' should not return a null pointer unless
    it is declared 'throw()' or 'noexcept' [-Wnew-returns-null]

This prevents the gdb.linespec/cpls-ops.exp testcase from executing.
This commit fixes.

gdb/testsuite/ChangeLog:

* gdb.linespec/cpls-ops.cc (dummy): New static global.
(test_op_new::operator new): Add return statement.
(test_op_new_array::operator new[]): Likewise.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.linespec/cpls-ops.cc
This page took 0.027643 seconds and 4 git commands to generate.