More clang-tidy fixes. These escaped before because -DDOWNLOAD_EIGEN=ON -DDOWNLOAD_CATCH=ON -DCMAKE_CXX_STANDARD=17, as used in the GitHub Actions, were missing in the interactive run.

This commit is contained in:
Ralf W. Grosse-Kunstleve 2021-06-22 14:42:47 -07:00
parent 2eeac0c369
commit 2c828ff552

View File

@ -10,7 +10,7 @@ namespace helpers {
struct movable_int { struct movable_int {
int valu; int valu;
movable_int(int v) : valu{v} {} movable_int(int v) : valu{v} {}
movable_int(movable_int &&other) { movable_int(movable_int &&other) noexcept {
valu = other.valu; valu = other.valu;
other.valu = 91; other.valu = 91;
} }
@ -325,7 +325,7 @@ TEST_CASE("error_cannot_disown_nullptr", "[E]") {
TEST_CASE("indestructible_int-from_raw_ptr_unowned+as_raw_ptr_unowned", "[S]") { TEST_CASE("indestructible_int-from_raw_ptr_unowned+as_raw_ptr_unowned", "[S]") {
using zombie = helpers::indestructible_int; using zombie = helpers::indestructible_int;
// Using placement new instead of plain new, to not trigger leak sanitizer errors. // Using placement new instead of plain new, to not trigger leak sanitizer errors.
static char memory_block[sizeof(zombie)]; static std::aligned_storage<sizeof(zombie), alignof(zombie)>::type memory_block[1];
auto *value = new (memory_block) zombie(19); auto *value = new (memory_block) zombie(19);
auto hld = smart_holder::from_raw_ptr_unowned(value); auto hld = smart_holder::from_raw_ptr_unowned(value);
REQUIRE(hld.as_raw_ptr_unowned<zombie>()->valu == 19); REQUIRE(hld.as_raw_ptr_unowned<zombie>()->valu == 19);