-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: fmt::print(...) infinite recursion when using std::filesystem::path and fmt/ranges.h header is included #1268
Comments
I wasn't able to make your example compile: https://godbolt.org/z/FKJcEH. Please provide more details including the compiler version and {fmt} library version. |
I see it doesn't compile. |
I made it compile on godbolt When fmt/ranges.h is not included the program runs fine. If I #include fmt/ranges.h it will crash I get ~94000 lines of stack so it is hard to copy paste here but it looks like this |
The problem is that |
Fixed in b2d4ca1. Thanks for reporting! |
Executing the following code will enter an infinite recursion and the program will crash
template <typename... Args>
auto capture(const Args&... args) {
return std::make_tuple(args...);
}
auto print_message = [](const auto&... args) {
fmt::print(args...);
};
int main()
{
std::filesystem::path ph {"test_path"};
auto args = capture("{}", ph);
std::apply(print_message, args);
}
The text was updated successfully, but these errors were encountered: