diff --git a/beast/utility/tests/weak_fn.test.cpp b/beast/utility/tests/weak_fn.test.cpp index 7137fc978..6d551ab78 100644 --- a/beast/utility/tests/weak_fn.test.cpp +++ b/beast/utility/tests/weak_fn.test.cpp @@ -108,9 +108,10 @@ public: auto p = std::make_shared(called); try { - std::bind(weak_fn(&T::fis, p, throw_if_invalid<>()), - 1, std::placeholders::_1)("foo"); + auto call = std::bind(weak_fn(&T::fis, p, throw_if_invalid<>()), + 1, std::placeholders::_1); p.reset(); + call("foo"); fail(); } catch(std::bad_weak_ptr const&)