From f9e43c3abf424e0f3de5773ac07ebe3f68bb7c39 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 21 Mar 2019 14:18:23 +0800 Subject: [PATCH] future: do not use "cold" attribute for lambda MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit to workaround GCC-9 bug: ../../include/seastar/core/future.hh: In member function ‘void seastar::promise::abandoned()’: ../../include/seastar/core/future.hh:1350:38: error: expected identifier before ‘{’ token 1350 | [&] () __attribute__((cold)) { | ^ ../../include/seastar/core/future.hh:1350:38: error: type-specifier invalid in lambda see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89640 Signed-off-by: Kefu Chai --- include/seastar/core/future.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/seastar/core/future.hh b/include/seastar/core/future.hh index 6a7ae323b88..7fdafb84966 100644 --- a/include/seastar/core/future.hh +++ b/include/seastar/core/future.hh @@ -1347,7 +1347,7 @@ void promise::abandoned() noexcept { assert(_state && !_state->available()); // Encourage the compiler to move this away from the hot paths. __builtin_expect is not enough // to do that. Cold lambdas work (at least for GCC8+). - [&] () __attribute__((cold)) { + [&] () { try { // Constructing broken_promise may throw (std::logic_error ctor is not noexcept). set_exception(broken_promise{});