From b5da81b6c2219e4259c2cf0fe4940148f1d66017 Mon Sep 17 00:00:00 2001 From: kamilsa Date: Thu, 7 Sep 2023 19:40:34 +0600 Subject: [PATCH] Update hunter, switch to C++20 (#214) * Update hunter links * Switch to C++20 * Update ci.yml * Remove ninja, fix cmake version * Fix event emitter test * Update cmake/toolchain/clang-15_cxx17.cmake Co-authored-by: Dmitriy Khaustov --------- Co-authored-by: Dmitriy Khaustov --- .github/workflows/ci.yml | 14 ++++---------- CMakeLists.txt | 2 +- cmake/Hunter/init.cmake | 6 +++--- cmake/Hunter/passwords.cmake | 3 +-- cmake/san.cmake | 10 +++++----- cmake/san/clang-14_cxx20_asan.cmake | 3 +++ cmake/san/clang-14_cxx20_lsan.cmake | 3 +++ cmake/san/clang-14_cxx20_msan.cmake | 3 +++ cmake/san/clang-14_cxx20_tsan.cmake | 3 +++ cmake/san/clang-14_cxx20_ubsan.cmake | 3 +++ cmake/san/clang-15_cxx20_asan.cmake | 3 +++ cmake/san/clang-8_cxx17_asan.cmake | 3 --- cmake/san/clang-8_cxx17_lsan.cmake | 3 --- cmake/san/clang-8_cxx17_msan.cmake | 3 --- cmake/san/clang-8_cxx17_tsan.cmake | 3 --- cmake/san/clang-8_cxx17_ubsan.cmake | 3 --- cmake/san/clang-9_cxx17_asan.cmake | 3 --- cmake/san/gcc-11_cxx20_asan.cmake | 3 +++ cmake/san/gcc-8_cxx17_asan.cmake | 3 --- cmake/toolchain/clang-15_cxx17.cmake | 3 +++ cmake/toolchain/clang-8_cxx17.cmake | 3 --- .../compiler/{clang-8.cmake => clang-14.cmake} | 8 ++++---- .../compiler/{clang-9.cmake => clang-15.cmake} | 8 ++++---- .../compiler/{gcc-8.cmake => gcc-11.cmake} | 8 ++++---- cmake/toolchain/{cxx17.cmake => cxx20.cmake} | 2 +- cmake/toolchain/gcc-11_cxx20.cmake | 3 +++ cmake/toolchain/gcc-8_cxx17.cmake | 3 --- src/transport/tcp/tcp_connection.cpp | 4 ++-- test/libp2p/event/event_emitter_test.cpp | 3 +++ 29 files changed, 59 insertions(+), 63 deletions(-) create mode 100644 cmake/san/clang-14_cxx20_asan.cmake create mode 100644 cmake/san/clang-14_cxx20_lsan.cmake create mode 100644 cmake/san/clang-14_cxx20_msan.cmake create mode 100644 cmake/san/clang-14_cxx20_tsan.cmake create mode 100644 cmake/san/clang-14_cxx20_ubsan.cmake create mode 100644 cmake/san/clang-15_cxx20_asan.cmake delete mode 100644 cmake/san/clang-8_cxx17_asan.cmake delete mode 100644 cmake/san/clang-8_cxx17_lsan.cmake delete mode 100644 cmake/san/clang-8_cxx17_msan.cmake delete mode 100644 cmake/san/clang-8_cxx17_tsan.cmake delete mode 100644 cmake/san/clang-8_cxx17_ubsan.cmake delete mode 100644 cmake/san/clang-9_cxx17_asan.cmake create mode 100644 cmake/san/gcc-11_cxx20_asan.cmake delete mode 100644 cmake/san/gcc-8_cxx17_asan.cmake create mode 100644 cmake/toolchain/clang-15_cxx17.cmake delete mode 100644 cmake/toolchain/clang-8_cxx17.cmake rename cmake/toolchain/compiler/{clang-8.cmake => clang-14.cmake} (79%) rename cmake/toolchain/compiler/{clang-9.cmake => clang-15.cmake} (81%) rename cmake/toolchain/compiler/{gcc-8.cmake => gcc-11.cmake} (72%) rename cmake/toolchain/{cxx17.cmake => cxx20.cmake} (70%) create mode 100644 cmake/toolchain/gcc-11_cxx20.cmake delete mode 100644 cmake/toolchain/gcc-8_cxx17.cmake diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d4fef66..8833ab83 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: fail-fast: false matrix: # 3 jobs in total - os: [ubuntu-20.04, macOS-latest] + os: [ubuntu-latest, macos-latest] compiler: [{ "cc": "gcc", "cxx": "g++" @@ -24,7 +24,7 @@ jobs: "cxx": "clang++" }] exclude: - - os: macOS-latest + - os: macos-latest compiler: cc: gcc steps: @@ -37,21 +37,15 @@ jobs: - name: install dependencies run: | set -e - if [ "$RUNNER_OS" = "macOS" ]; then - brew install ninja - else - sudo apt-get update || true - sudo apt-get install -y ninja-build - fi sudo python3 -m pip install --upgrade pip sudo pip3 install scikit-build - sudo pip3 install cmake requests gitpython gcovr pyyaml + sudo pip3 install cmake=="3.25.0" requests gitpython gcovr pyyaml - name: cmake env: CC: ${{ matrix.compiler.cc }} CXX: ${{ matrix.compiler.cxx }} - run: cmake . -GNinja -Bbuild + run: cmake . -Bbuild - name: build run: cmake --build build -- -j4 - name: test diff --git a/CMakeLists.txt b/CMakeLists.txt index 370f17c8..08d0ffbe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ if (CCACHE_FOUND) endif (CCACHE_FOUND) set(CMAKE_TOOLCHAIN_FILE - "${CMAKE_SOURCE_DIR}/cmake/toolchain/cxx17.cmake" + "${CMAKE_SOURCE_DIR}/cmake/toolchain/cxx20.cmake" CACHE FILEPATH "Default toolchain" diff --git a/cmake/Hunter/init.cmake b/cmake/Hunter/init.cmake index 01062428..882487c1 100644 --- a/cmake/Hunter/init.cmake +++ b/cmake/Hunter/init.cmake @@ -22,7 +22,7 @@ set( set( HUNTER_CACHE_SERVERS - "https://github.com/soramitsu/hunter-binary-cache" + "https://github.com/qdrvm/hunter-binary-cache" CACHE STRING "Binary cache server" @@ -31,7 +31,7 @@ set( include(${CMAKE_CURRENT_LIST_DIR}/HunterGate.cmake) HunterGate( - URL "https://github.com/soramitsu/soramitsu-hunter/archive/v0.23.257-soramitsu42.tar.gz" - SHA1 "6f54ad82c2322ff0e234ab96a44a12da1478f1be" + URL "https://github.com/qdrvm/hunter/archive/refs/tags/v0.23.257-qdrvm1.zip" + SHA1 "e6aee2a8086d749d19d31d587f1f19c750a820ea" LOCAL ) diff --git a/cmake/Hunter/passwords.cmake b/cmake/Hunter/passwords.cmake index b475ea14..39394d3d 100644 --- a/cmake/Hunter/passwords.cmake +++ b/cmake/Hunter/passwords.cmake @@ -1,9 +1,8 @@ hunter_upload_password( # REPO_OWNER + REPO = https://github.com/forexample/hunter-cache - REPO_OWNER "soramitsu" + REPO_OWNER "qdrvm" REPO "hunter-binary-cache" - # USERNAME = warchant USERNAME "$ENV{GITHUB_HUNTER_USERNAME}" # PASSWORD = GitHub token saved as a secure environment variable diff --git a/cmake/san.cmake b/cmake/san.cmake index fa4098f0..1abe1b12 100644 --- a/cmake/san.cmake +++ b/cmake/san.cmake @@ -1,16 +1,16 @@ if(ASAN) print("Address Sanitizer is enabled") - include(${CMAKE_CURRENT_LIST_DIR}/san/clang-8_cxx17_asan.cmake) + include(${CMAKE_CURRENT_LIST_DIR}/san/clang-14_cxx20_asan.cmake) elseif(LSAN) print("Leak Sanitizer is enabled") - include(${CMAKE_CURRENT_LIST_DIR}/san/clang-8_cxx17_lsan.cmake) + include(${CMAKE_CURRENT_LIST_DIR}/san/clang-14_cxx20_lsan.cmake) elseif(MSAN) print("Memory Sanitizer is enabled") - include(${CMAKE_CURRENT_LIST_DIR}/san/clang-8_cxx17_msan.cmake) + include(${CMAKE_CURRENT_LIST_DIR}/san/clang-14_cxx20_msan.cmake) elseif(TSAN) print("Thread Sanitizer is enabled") - include(${CMAKE_CURRENT_LIST_DIR}/san/clang-8_cxx17_tsan.cmake) + include(${CMAKE_CURRENT_LIST_DIR}/san/clang-14_cxx20_tsan.cmake) elseif(UBSAN) print("Undefined Behavior Sanitizer is enabled") - include(${CMAKE_CURRENT_LIST_DIR}/san/clang-8_cxx17_ubsan.cmake) + include(${CMAKE_CURRENT_LIST_DIR}/san/clang-14_cxx20_ubsan.cmake) endif() diff --git a/cmake/san/clang-14_cxx20_asan.cmake b/cmake/san/clang-14_cxx20_asan.cmake new file mode 100644 index 00000000..9a41f7ec --- /dev/null +++ b/cmake/san/clang-14_cxx20_asan.cmake @@ -0,0 +1,3 @@ +include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/flags/sanitize_address.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/compiler/clang-14.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/cxx20.cmake) diff --git a/cmake/san/clang-14_cxx20_lsan.cmake b/cmake/san/clang-14_cxx20_lsan.cmake new file mode 100644 index 00000000..b1beaaa4 --- /dev/null +++ b/cmake/san/clang-14_cxx20_lsan.cmake @@ -0,0 +1,3 @@ +include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/flags/sanitize_leak.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/compiler/clang-14.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/cxx20.cmake) diff --git a/cmake/san/clang-14_cxx20_msan.cmake b/cmake/san/clang-14_cxx20_msan.cmake new file mode 100644 index 00000000..4d07ff1a --- /dev/null +++ b/cmake/san/clang-14_cxx20_msan.cmake @@ -0,0 +1,3 @@ +include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/flags/sanitize_memory.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/compiler/clang-14.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/cxx20.cmake) diff --git a/cmake/san/clang-14_cxx20_tsan.cmake b/cmake/san/clang-14_cxx20_tsan.cmake new file mode 100644 index 00000000..cad57543 --- /dev/null +++ b/cmake/san/clang-14_cxx20_tsan.cmake @@ -0,0 +1,3 @@ +include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/flags/sanitize_thread.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/compiler/clang-14.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/cxx20.cmake) diff --git a/cmake/san/clang-14_cxx20_ubsan.cmake b/cmake/san/clang-14_cxx20_ubsan.cmake new file mode 100644 index 00000000..ecafe8f5 --- /dev/null +++ b/cmake/san/clang-14_cxx20_ubsan.cmake @@ -0,0 +1,3 @@ +include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/flags/sanitize_undefined.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/compiler/clang-14.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/cxx20.cmake) diff --git a/cmake/san/clang-15_cxx20_asan.cmake b/cmake/san/clang-15_cxx20_asan.cmake new file mode 100644 index 00000000..bd1c8c03 --- /dev/null +++ b/cmake/san/clang-15_cxx20_asan.cmake @@ -0,0 +1,3 @@ +include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/flags/sanitize_address.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/compiler/clang-15.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/cxx20.cmake) diff --git a/cmake/san/clang-8_cxx17_asan.cmake b/cmake/san/clang-8_cxx17_asan.cmake deleted file mode 100644 index de6c5814..00000000 --- a/cmake/san/clang-8_cxx17_asan.cmake +++ /dev/null @@ -1,3 +0,0 @@ -include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/flags/sanitize_address.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/compiler/clang-8.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/cxx17.cmake) diff --git a/cmake/san/clang-8_cxx17_lsan.cmake b/cmake/san/clang-8_cxx17_lsan.cmake deleted file mode 100644 index 390d2bb6..00000000 --- a/cmake/san/clang-8_cxx17_lsan.cmake +++ /dev/null @@ -1,3 +0,0 @@ -include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/flags/sanitize_leak.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/compiler/clang-8.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/cxx17.cmake) diff --git a/cmake/san/clang-8_cxx17_msan.cmake b/cmake/san/clang-8_cxx17_msan.cmake deleted file mode 100644 index fce8dd8b..00000000 --- a/cmake/san/clang-8_cxx17_msan.cmake +++ /dev/null @@ -1,3 +0,0 @@ -include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/flags/sanitize_memory.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/compiler/clang-8.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/cxx17.cmake) diff --git a/cmake/san/clang-8_cxx17_tsan.cmake b/cmake/san/clang-8_cxx17_tsan.cmake deleted file mode 100644 index b2713e1b..00000000 --- a/cmake/san/clang-8_cxx17_tsan.cmake +++ /dev/null @@ -1,3 +0,0 @@ -include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/flags/sanitize_thread.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/compiler/clang-8.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/cxx17.cmake) diff --git a/cmake/san/clang-8_cxx17_ubsan.cmake b/cmake/san/clang-8_cxx17_ubsan.cmake deleted file mode 100644 index bbb79174..00000000 --- a/cmake/san/clang-8_cxx17_ubsan.cmake +++ /dev/null @@ -1,3 +0,0 @@ -include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/flags/sanitize_undefined.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/compiler/clang-8.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/cxx17.cmake) diff --git a/cmake/san/clang-9_cxx17_asan.cmake b/cmake/san/clang-9_cxx17_asan.cmake deleted file mode 100644 index 19f00fd9..00000000 --- a/cmake/san/clang-9_cxx17_asan.cmake +++ /dev/null @@ -1,3 +0,0 @@ -include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/flags/sanitize_address.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/compiler/clang-9.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/cxx17.cmake) diff --git a/cmake/san/gcc-11_cxx20_asan.cmake b/cmake/san/gcc-11_cxx20_asan.cmake new file mode 100644 index 00000000..936ecfe8 --- /dev/null +++ b/cmake/san/gcc-11_cxx20_asan.cmake @@ -0,0 +1,3 @@ +include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/flags/sanitize_address.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/compiler/gcc-11.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/cxx20.cmake) diff --git a/cmake/san/gcc-8_cxx17_asan.cmake b/cmake/san/gcc-8_cxx17_asan.cmake deleted file mode 100644 index 9a86ea73..00000000 --- a/cmake/san/gcc-8_cxx17_asan.cmake +++ /dev/null @@ -1,3 +0,0 @@ -include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/flags/sanitize_address.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/compiler/gcc-8.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/cxx17.cmake) diff --git a/cmake/toolchain/clang-15_cxx17.cmake b/cmake/toolchain/clang-15_cxx17.cmake new file mode 100644 index 00000000..ec14ed67 --- /dev/null +++ b/cmake/toolchain/clang-15_cxx17.cmake @@ -0,0 +1,3 @@ +include(${CMAKE_CURRENT_LIST_DIR}/../print.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/compiler/clang-15.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/cxx20.cmake) diff --git a/cmake/toolchain/clang-8_cxx17.cmake b/cmake/toolchain/clang-8_cxx17.cmake deleted file mode 100644 index bbca0552..00000000 --- a/cmake/toolchain/clang-8_cxx17.cmake +++ /dev/null @@ -1,3 +0,0 @@ -include(${CMAKE_CURRENT_LIST_DIR}/../print.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/compiler/clang-8.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/cxx17.cmake) diff --git a/cmake/toolchain/compiler/clang-8.cmake b/cmake/toolchain/compiler/clang-14.cmake similarity index 79% rename from cmake/toolchain/compiler/clang-8.cmake rename to cmake/toolchain/compiler/clang-14.cmake index e4d1f2d1..86be07d0 100644 --- a/cmake/toolchain/compiler/clang-8.cmake +++ b/cmake/toolchain/compiler/clang-14.cmake @@ -11,15 +11,15 @@ if(XCODE_VERSION) fatal_error(${_err}) endif() -find_program(CMAKE_C_COMPILER clang-8) -find_program(CMAKE_CXX_COMPILER clang++-8) +find_program(CMAKE_C_COMPILER clang-14) +find_program(CMAKE_CXX_COMPILER clang++-14) if(NOT CMAKE_C_COMPILER) - fatal_error("clang-8 not found") + fatal_error("clang-14 not found") endif() if(NOT CMAKE_CXX_COMPILER) - fatal_error("clang++-8 not found") + fatal_error("clang++-14 not found") endif() set( diff --git a/cmake/toolchain/compiler/clang-9.cmake b/cmake/toolchain/compiler/clang-15.cmake similarity index 81% rename from cmake/toolchain/compiler/clang-9.cmake rename to cmake/toolchain/compiler/clang-15.cmake index f4c5c344..d2e9cdcb 100644 --- a/cmake/toolchain/compiler/clang-9.cmake +++ b/cmake/toolchain/compiler/clang-15.cmake @@ -13,15 +13,15 @@ if(XCODE_VERSION) fatal_error(${_err}) endif() -find_program(CMAKE_C_COMPILER clang-9) -find_program(CMAKE_CXX_COMPILER clang++-9) +find_program(CMAKE_C_COMPILER clang-15) +find_program(CMAKE_CXX_COMPILER clang++-15) if(NOT CMAKE_C_COMPILER) - fatal_error("clang-9 not found") + fatal_error("clang-15 not found") endif() if(NOT CMAKE_CXX_COMPILER) - fatal_error("clang++-9 not found") + fatal_error("clang++-15 not found") endif() set( diff --git a/cmake/toolchain/compiler/gcc-8.cmake b/cmake/toolchain/compiler/gcc-11.cmake similarity index 72% rename from cmake/toolchain/compiler/gcc-8.cmake rename to cmake/toolchain/compiler/gcc-11.cmake index d4a62178..3c9a437d 100644 --- a/cmake/toolchain/compiler/gcc-8.cmake +++ b/cmake/toolchain/compiler/gcc-11.cmake @@ -4,15 +4,15 @@ else() set(POLLY_COMPILER_GCC_8_CMAKE_ 1) endif() -find_program(CMAKE_C_COMPILER gcc-8) -find_program(CMAKE_CXX_COMPILER g++-8) +find_program(CMAKE_C_COMPILER gcc-11) +find_program(CMAKE_CXX_COMPILER g++-11) if(NOT CMAKE_C_COMPILER) - fatal_error("gcc-8 not found") + fatal_error("gcc-11 not found") endif() if(NOT CMAKE_CXX_COMPILER) - fatal_error("g++-8 not found") + fatal_error("g++-11 not found") endif() set( diff --git a/cmake/toolchain/cxx17.cmake b/cmake/toolchain/cxx20.cmake similarity index 70% rename from cmake/toolchain/cxx17.cmake rename to cmake/toolchain/cxx20.cmake index 50c933e8..ec4d8165 100644 --- a/cmake/toolchain/cxx17.cmake +++ b/cmake/toolchain/cxx20.cmake @@ -1,3 +1,3 @@ -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) diff --git a/cmake/toolchain/gcc-11_cxx20.cmake b/cmake/toolchain/gcc-11_cxx20.cmake new file mode 100644 index 00000000..65c9a487 --- /dev/null +++ b/cmake/toolchain/gcc-11_cxx20.cmake @@ -0,0 +1,3 @@ +include(${CMAKE_CURRENT_LIST_DIR}/../print.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-11.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/cxx20.cmake) diff --git a/cmake/toolchain/gcc-8_cxx17.cmake b/cmake/toolchain/gcc-8_cxx17.cmake deleted file mode 100644 index 1e513807..00000000 --- a/cmake/toolchain/gcc-8_cxx17.cmake +++ /dev/null @@ -1,3 +0,0 @@ -include(${CMAKE_CURRENT_LIST_DIR}/../print.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-8.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/cxx17.cmake) diff --git a/src/transport/tcp/tcp_connection.cpp b/src/transport/tcp/tcp_connection.cpp index 28cbd5a0..b944bf7f 100644 --- a/src/transport/tcp/tcp_connection.cpp +++ b/src/transport/tcp/tcp_connection.cpp @@ -188,8 +188,8 @@ namespace libp2p::transport { } boost::asio::async_connect( socket_, iterator, - [wptr{weak_from_this()}, cb{std::move(cb)}](auto &&ec, - auto &&endpoint) { + [wptr{weak_from_this()}, cb{std::move(cb)}]( + auto &&ec, const Tcp::endpoint &endpoint) { auto self = wptr.lock(); if (!self || self->closed_by_host_) { return; diff --git a/test/libp2p/event/event_emitter_test.cpp b/test/libp2p/event/event_emitter_test.cpp index d6a04c14..096c137b 100644 --- a/test/libp2p/event/event_emitter_test.cpp +++ b/test/libp2p/event/event_emitter_test.cpp @@ -83,6 +83,7 @@ TEST_F(EventEmitterTest, Unsubscribe) { */ TEST_F(EventEmitterTest, NonCopyableEvent) { struct NonCopyableEvent { + explicit NonCopyableEvent(int i) : value(i) {} NonCopyableEvent(const NonCopyableEvent &other) = delete; NonCopyableEvent &operator=(const NonCopyableEvent &other) = delete; NonCopyableEvent(NonCopyableEvent &&other) noexcept = default; @@ -109,6 +110,7 @@ TEST_F(EventEmitterTest, NonCopyableEvent) { */ TEST_F(EventEmitterTest, NonMovableEvent) { struct NonMovableEvent { + explicit NonMovableEvent(int v) : value(v) {} NonMovableEvent(const NonMovableEvent &other) = default; NonMovableEvent &operator=(const NonMovableEvent &other) = default; NonMovableEvent(NonMovableEvent &&other) noexcept = delete; @@ -134,6 +136,7 @@ TEST_F(EventEmitterTest, NonMovableEvent) { */ TEST_F(EventEmitterTest, NonCopyableOrMovableEvent) { struct NonCopyableOrMovableEvent { + explicit NonCopyableOrMovableEvent(int v) : value(v) {} NonCopyableOrMovableEvent(const NonCopyableOrMovableEvent &other) = delete; NonCopyableOrMovableEvent &operator=( const NonCopyableOrMovableEvent &other) = delete;