From dc127f39a787a2919a5aa90b75b85753ae64c012 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 22 May 2023 15:01:00 +0200 Subject: [PATCH] util/ScopeExit: use std::declval() Fixes GCC 10 error: error: cannot call member function `Foo` without object --- src/util/ScopeExit.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/ScopeExit.hxx b/src/util/ScopeExit.hxx index a53282676..b50468702 100644 --- a/src/util/ScopeExit.hxx +++ b/src/util/ScopeExit.hxx @@ -50,7 +50,7 @@ public: "noexcept" declaration allows the destructor to throw if the function can throw; without this, a throwing function would std::terminate() */ - ~ScopeExitGuard() noexcept(noexcept(F::operator()())) { + ~ScopeExitGuard() noexcept(noexcept(std::declval()())) { if (enabled) F::operator()(); }