diff --git a/include/trompeloeil/mock.hpp b/include/trompeloeil/mock.hpp index 8a9df5c..0d15874 100644 --- a/include/trompeloeil/mock.hpp +++ b/include/trompeloeil/mock.hpp @@ -1330,7 +1330,7 @@ template return next != this; } protected: - list_elem() noexcept = default; + list_elem() = default; public: list_elem* next = this; list_elem* prev = this; @@ -1678,7 +1678,7 @@ template virtual ~sequence_handler_base() - noexcept = default; + = default; void increment_call() @@ -3224,11 +3224,12 @@ template struct expectations { expectations() = default; - expectations(expectations&&) noexcept = default; + expectations(expectations&&) = default; ~expectations() { active.decommission(); saturated.decommission(); } + expectations& operator=(expectations&&) = default; call_matcher_list active{}; call_matcher_list saturated{}; }; diff --git a/include/trompeloeil/sequence.hpp b/include/trompeloeil/sequence.hpp index 45ea9a5..1357a8f 100644 --- a/include/trompeloeil/sequence.hpp +++ b/include/trompeloeil/sequence.hpp @@ -24,10 +24,10 @@ namespace trompeloeil { class sequence_type { public: - sequence_type() noexcept = default; - sequence_type(sequence_type&&) noexcept = delete; + sequence_type() = default; + sequence_type(sequence_type&&) = delete; sequence_type(const sequence_type&) = delete; - sequence_type& operator=(sequence_type&&) noexcept = delete; + sequence_type& operator=(sequence_type&&) = delete; sequence_type& operator=(const sequence_type&) = delete; ~sequence_type(); diff --git a/test/compiling_tests_11.cpp b/test/compiling_tests_11.cpp index 49a6346..3832287 100644 --- a/test/compiling_tests_11.cpp +++ b/test/compiling_tests_11.cpp @@ -5996,3 +5996,19 @@ TEST_CASE_METHOD( REQUIRE(called); } +TEST_CASE_METHOD( + Fixture, + "C++11: A named expectation follows a moved mock object assign", + "[C++11][C++14]" +) +{ + bool called = false; + movable_mock source; + auto exp = NAMED_REQUIRE_CALL_V(source, func(3), + .LR_SIDE_EFFECT(called = true)); + movable_mock dest; + dest = std::move(source); + dest.func(3); + REQUIRE(reports.empty()); + REQUIRE(called); +} diff --git a/test/micro_coro.hpp b/test/micro_coro.hpp index c390cd0..6b93b11 100644 --- a/test/micro_coro.hpp +++ b/test/micro_coro.hpp @@ -27,7 +27,7 @@ namespace coro template struct promise { - promise() noexcept = default; + promise() = default; promise &operator=(promise &&) = delete; @@ -137,7 +137,7 @@ namespace coro template<> struct promise { - promise() noexcept = default; + promise() = default; promise &operator=(promise &&) = delete; std::suspend_never @@ -347,7 +347,7 @@ namespace coro template struct generator_promise { - generator_promise() noexcept = default; + generator_promise() = default; generator_promise &operator=(generator_promise &&) = delete;