Skip to content

deployment.md: the Secret formatter doesn't compile with libc++ 18 (format takes only format_context) #384

Closed

Description

@homer6

Found by the v0.5.0 fix-up run (https://github.com/homer6/cpp-docs/actions/runs/41689101415), tracking #363. In the first release run this job never got past the toolchain step (apt.llvm.org outage).

linux.yml / Clang 18 libcxx: tests/security/deployment_test.cpp doesn't build:

deployment_test.cpp:93:27: error: call to consteval function 'std::basic_format_string<char, const Secret &>::basic_format_string<char[9]>' is not a constant expression
format_arg_store.h:167:17: error: static assertion failed ...: the supplied type is not formattable

The page's formatter (Keep logs safe to keep) declares format(const Secret&, std::format_context&). libc++ 18 checks formattability with its own internal context type, so a formatter that accepts only std::format_context counts as not formattable.

Reproduced with Ubuntu 24.04's clang-18 + libc++-18:

  • the format_context signature fails;
  • a templated format(const Secret&, FormatContext&) prints token=[redacted].

Both compile and run on Clang 22 (libc++) and GCC 15. In the same run, libc++ 19, 20, 22 and 23 and every Windows job (MS STL, MSYS2, clang-cl) passed.

Fix: the page and the test write format as a template on the context, and the page says why.

Activity

  1. self-assigned this
    on Nov 3, 2026
  2. homer6 commented on Nov 3, 2026

    @homer6
    OwnerAuthor

    Delivered in #385.

    What changed

    • The page's and the test's std::formatter<Secret>::format is a template on the context, and the page says why.

    Why

    • libc++ 18 rejects a format_context-only formatter. Reproduced with Ubuntu 24.04's clang 18 + libc++ 18; the templated version prints token=[redacted] there and on Clang 22 and GCC 15.

    Still open

    • Proof in CI: the Clang 18 libc++ job re-run.
  3. homer6 commented on Nov 3, 2026

    @homer6
    OwnerAuthor

    Merged in #385 (b261459).

    What changed

    • Nothing since the PR was opened.

    Why

    • Merged on the owner's review.

    Still open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions