]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/mds/TestQuiesceDb.cc: fix sequence point error for rocky 10
authorSamuel Just <sjust@redhat.com>
Thu, 24 Jul 2025 21:44:39 +0000 (14:44 -0700)
committerSamuel Just <sjust@redhat.com>
Thu, 21 Aug 2025 15:58:43 +0000 (08:58 -0700)
src/test/mds/TestQuiesceDb.cc:512:10: error: operation on 'q' may be undefined [-Werror=sequence-point]

Signed-off-by: Samuel Just <sjust@redhat.com>
src/test/mds/TestQuiesceDb.cc

index 985325a4e9fa8a43c68dcb22c42edc016ecc965c..7f416e2aaa8307bf7eca1216b2275b4e930bb206 100644 (file)
@@ -509,8 +509,14 @@ void cartesian_apply(F func, std::array<V, S> const & ... array_args) {
 
     // we use parameter pack expansion as part of the brace initializer
     // to perform sequential calculation of the 
+
+    auto f = [&q](const auto &args) {
+      q = div(q.quot, args.size());
+      return args.at(q.rem);
+    };
+
     auto apply_tuple = std::tuple<V const &...> { 
-      (q = div(q.quot, array_args.size()), array_args.at(q.rem)) 
+      f(array_args)
       ... 
     };