Using g++ a.cpp -std=c++20 the following compiles successfully even so it should not. #include <format> int main(int argc, char* argv[]) { std::string a("a"); return format("a{}", a)!="aa"; } Passing an int, float, bool or a string literal to format instead raises the correct not declared error.
This is how the standard argument depedent lookup works ...
This is now documented as not-a-bug: https://gcc.gnu.org/bugs/#nonbugs_cxx