]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rgw: remove FMT_STRING to fix clang 20+ build failure 66928/head
authorZ. Liu <zhixu.liu@gmail.com>
Wed, 14 Jan 2026 14:46:39 +0000 (22:46 +0800)
committerZ. Liu <zhixu.liu@gmail.com>
Fri, 16 Jan 2026 03:09:12 +0000 (11:09 +0800)
commit4965dbac4bd17973eb15fe09d2a046a509b4a65a
tree8686c4b4b44777e82bd3907951c18435b9ef3309
parentbc209e6daff0690959c9cf52d6c6cae699ad1b4d
rgw: remove FMT_STRING to fix clang 20+ build failure

Fix a build failure with Clang 20+ using -std=c++20, where fmt
(v9.1.0, v11.0.0, and possibly other versions) fails to parse
format strings at compile-time in a consteval context. This is
a known issue in fmt, fixed in fmt v11.1.0 (see
https://github.com/fmtlib/fmt/commit/6797f0c39a4ef13061cbc3bb850c35af7428fdc4).

The following error occurs when building rgw_auth_s3.cc:

  src/rgw/rgw_auth_s3.cc:600:22: error: call to consteval function
  'fmt::basic_format_string<...>' is not a constant expression

Removing FMT_STRING avoids compile-time format string parsing
and restores buildability across different toolchains.

Test case:

  #include <fmt/format.h>

  std::string gen_v4_scope(const std::string& region)
  {
    return fmt::format(FMT_STRING("{:s}"), region);
  }

Compile with:

  clang -isystem fmt/include -std=c++20 -c test.cc

Signed-off-by: Z. Liu <zhixu.liu@gmail.com>
src/rgw/rgw_auth_s3.cc