From 620872390b089a9d33bbcece5e8801819e002004 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 1 Feb 2020 13:13:08 +0100 Subject: [PATCH] util/Exception: move the forwarded std::exception_ptr --- src/util/Exception.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/Exception.cxx b/src/util/Exception.cxx index 43f13865a..acb78f68a 100644 --- a/src/util/Exception.cxx +++ b/src/util/Exception.cxx @@ -29,6 +29,8 @@ #include "Exception.hxx" +#include + template static void AppendNestedMessage(std::string &result, T &&e, @@ -65,7 +67,7 @@ GetFullMessage(std::exception_ptr ep, const char *fallback, const char *separator) noexcept { try { - std::rethrow_exception(ep); + std::rethrow_exception(std::move(ep)); } catch (const std::exception &e) { return GetFullMessage(e, fallback, separator); } catch (const std::nested_exception &ne) {