diff --git a/CMakeLists.txt b/CMakeLists.txt index 09d03a7a78fc5b9bd3b49f242a32d97debccfe3a..84738ea197786ab8c9f3f73371e6b3c20c386ef4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -323,7 +323,7 @@ if(_LINTING) else() message(STATUS "clang-tidy: ${clang_tidy}") set(_CMAKE_CXX_CLANG_TIDY_CHECKS - "--checks=*,-fuchsia-*,-llvmlibc-*,-readability-convert-member-functions-to-static,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-hicpp-no-array-decay,-llvm-else-after-return,-readability-else-after-return,-modernize-use-trailing-return-type,-bugprone-branch-clone,-altera-*,-cppcoreguidelines-macro-usage,-*-avoid-c-arrays") + "--checks=*,-fuchsia-*,-llvmlibc-*,-readability-convert-member-functions-to-static,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-hicpp-no-array-decay,-llvm-else-after-return,-readability-else-after-return,-modernize-use-trailing-return-type,-bugprone-branch-clone,-altera-*,-cppcoreguidelines-macro-usage,-*-avoid-c-arrays,-cppcoreguidelines-owning-memory") set(_CMAKE_C_CLANG_TIDY_CHECKS "${_CMAKE_CXX_CLANG_TIDY_CHECKS}") set(_CMAKE_CXX_CLANG_TIDY "${clang_tidy}" "--header-filter=caosdb/.*[^\(\.pb\.h\)]$" diff --git a/include/caosdb/utility.h b/include/caosdb/utility.h index d7497e4658ba620096a78a6f0269ef16ebd0b379..43fbf8224b6a6ab7b4faa677036c087d48d754a4 100644 --- a/include/caosdb/utility.h +++ b/include/caosdb/utility.h @@ -137,14 +137,14 @@ public: * * Also moves the `wrapped` object. */ - JsonValue(JsonValue &&other); + JsonValue(JsonValue &&other) noexcept ; /** * Move Assigment. * * Also moves the `wrapped` object. */ - auto operator=(JsonValue &&other) -> JsonValue &; + auto operator=(JsonValue &&other) noexcept -> JsonValue &; /** * Return true if the `wrapped` object is the nullptr. diff --git a/src/caosdb/configuration.cpp b/src/caosdb/configuration.cpp index a9699cc949218502b10be60f12765fa2fa0bf423..5d1874a74e23f6f85bed6f180ca2a52ecb23ec79 100644 --- a/src/caosdb/configuration.cpp +++ b/src/caosdb/configuration.cpp @@ -479,7 +479,8 @@ auto ConfigurationManager::InitializeDefaults() -> int { // NOLINT "We are using the default configuration"; } - if (configuration_file_path != nullptr && !this->json_configuration.IsNull() && WRAPPED_JSON_CONFIGURATION(this)->is_object()) { + if (configuration_file_path != nullptr && !this->json_configuration.IsNull() && + WRAPPED_JSON_CONFIGURATION(this)->is_object()) { CAOSDB_LOG_INFO(logger_name) << "Loaded configuration from " << *(configuration_file_path) << "."; } diff --git a/src/caosdb/utility.cpp b/src/caosdb/utility.cpp index 1329dca14978d06311e8a7d5b54970e925477d9a..8617138ab6a4f8dac6bcc016ed15bcdddd59fbb4 100644 --- a/src/caosdb/utility.cpp +++ b/src/caosdb/utility.cpp @@ -147,7 +147,7 @@ auto load_json_file(const path &json_file) -> JsonValue { JsonValue::~JsonValue() { this->Reset(); } auto JsonValue::Reset() -> void { - void *tmp = std::move(this->wrapped); + void *tmp = this->wrapped; this->wrapped = nullptr; if (tmp != nullptr) { delete static_cast<value *>(tmp); @@ -170,16 +170,14 @@ auto JsonValue::operator=(const JsonValue &other) -> JsonValue & { return *this; } -JsonValue::JsonValue(JsonValue &&other) : wrapped(nullptr) { - std::cout << "MoveConstructor" << std::endl; +JsonValue::JsonValue(JsonValue &&other) noexcept : wrapped(nullptr) { if (!other.IsNull()) { this->wrapped = other.wrapped; other.wrapped = nullptr; } } -auto JsonValue::operator=(JsonValue &&other) -> JsonValue & { - std::cout << "MoveAssignment" << std::endl; +auto JsonValue::operator=(JsonValue &&other) noexcept -> JsonValue & { if (this != &other) { this->wrapped = other.wrapped; other.wrapped = nullptr;