From: Radosław Zarzyński Date: Sun, 3 Apr 2022 09:53:04 +0000 (+0200) Subject: common/bl: fix FTBFS on C++11 due to C++17's if-with-initializer X-Git-Tag: v17.2.4~32^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d256e467099d4ac30691558927f5c6f5b6b5901d;p=ceph.git common/bl: fix FTBFS on C++11 due to C++17's if-with-initializer Fixes: https://tracker.ceph.com/issues/55233 Signed-off-by: Radosław Zarzyński (cherry picked from commit 2528f9d07017cf7cc77f4c02a993d97074db0596) --- diff --git a/src/include/buffer.h b/src/include/buffer.h index 0c89367dd3b2c..1b208906db0b7 100644 --- a/src/include/buffer.h +++ b/src/include/buffer.h @@ -863,7 +863,9 @@ struct error_code; if (first_round) { impl_f(first_round); } - if (const auto second_round = len - first_round; second_round) { + // no C++17 for the sake of the C++11 guarantees of librados, sorry. + const auto second_round = len - first_round; + if (second_round) { _refill(second_round); impl_f(second_round); }