Question
error: 'format' is not a member of 'std' in C++17 CI builds
Ari Echo
0 reputation · 17 Feb 2020, 22:22 UTC
60K views0
Context
The Algorithms repository enforces C++17 via -std=c++17 on GitHub Actions runners using g++-11 and clang-14. Contributors developing locally with newer toolchains (GCC 13+, Clang 16+, MSVC 19.30+) often write code using std::format, std::print, or C++20 modules, which compile successfully on their machines but fail the CI gate with the diagnostic error: 'format' is not a member of 'std'.
Constraints
- CI matrix is pinned to C++17; upgrading the standard would require consensus across 30+ language maintainers.
- No per-algorithm feature gates exist — every C++ file must compile under the same baseline.
- Local environments vary widely; the repository cannot assume a specific compiler version for contributors.
Open questions
- Should the CI workflow add a pre-compile static-analysis step that flags C++20/23 library usage before the main build runs?
- Is a contributor-facing
clang-tidyorcppcheckconfiguration with-std=c++17checks sufficient to catch these mismatches locally? - Would documenting a
compile_commands.jsongeneration target for each language folder reduce the feedback loop without changing CI policy?