From 9f414ea58264fe0a62172a06f4653adc7556c164 Mon Sep 17 00:00:00 2001 From: "Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com)" Date: Mon, 27 Apr 2020 12:00:22 +0100 Subject: [PATCH] Fix https://github.com/ned14/outcome/issues/223 where in debug builds, cloning a status_code_ptr causes a segfault. --- include/status_code_ptr.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/status_code_ptr.hpp b/include/status_code_ptr.hpp index 0f5efa1..bd5c278 100644 --- boost_1_73_0/boost/outcome/experimental/status-code/status_code_ptr.hpp +++ boost_1_73_0/boost/outcome/experimental/status-code/status_code_ptr.hpp @@ -97,7 +97,7 @@ namespace detail #endif virtual void _do_erased_copy(status_code &dst, const status_code &src, size_t /*unused*/) const override // NOLINT { - assert(dst.domain() == *this); + // Note that dst will not have its domain set assert(src.domain() == *this); auto &d = static_cast<_mycode &>(dst); // NOLINT const auto &_s = static_cast(src); // NOLINT