You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
deployment.md: the Secret formatter doesn't compile with libc++ 18 (format takes only format_context) #384
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.
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.
Activity
homer6 commentedon Nov 3, 2026
Delivered in #385.
What changed
std::formatter<Secret>::formatis a template on the context, and the page says why.Why
format_context-only formatter. Reproduced with Ubuntu 24.04's clang 18 + libc++ 18; the templated version printstoken=[redacted]there and on Clang 22 and GCC 15.Still open
homer6 commentedon Nov 3, 2026
Merged in #385 (b261459).
What changed
Why
Still open