Skip to content
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

fmt::format doesn't seem to work with bidirectional nested ranges #3710

Closed
hewillk opened this issue Nov 10, 2023 · 5 comments
Closed

fmt::format doesn't seem to work with bidirectional nested ranges #3710

hewillk opened this issue Nov 10, 2023 · 5 comments

Comments

@hewillk
Copy link

hewillk commented Nov 10, 2023

I encountered a very strange issue, {fmt} rejected the following, but libc++ will not as expected.
Not sure if this is a bug or if I'm missing something. (I will try to find the root cause when I have time)

#include <ranges>
#include <fmt/ranges.h>
#include <list>
#include <format>
#include <print>

int main() {
  std::list l{1, 2, 3, 4, 5, 6};
  auto r = std::views::iota(0, 6)
         | std::views::transform([&l](auto i) { return std::views::take(std::ranges::subrange(l), i); })
         | std::views::transform(std::views::reverse);
  std::println("{}", r); // ok
  fmt::println("{}", r); // error: no matching member function for call to 'format'
}

https://godbolt.org/z/KhGYGhMzY

@GloriousEggroll
Copy link

not sure if this is the exact same issue but cemu fails to build on fedora 39 with what seems to be the same error: no matching member function for call to 'format' issue. Reverting b3fa3480dd3b5c99b24136382953f1fd21b75488 "Call element parse in tuple parse" is enough to allow it to compile.

@GloriousEggroll
Copy link

apparently this is fixed (on the cemu build anyway) with fmt 10.1

@vitaut
Copy link
Contributor

vitaut commented Dec 23, 2023

Fixed in e7875ae. Thanks for reporting.

@hewillk
Copy link
Author

hewillk commented May 21, 2024

This was resolved in 10.2.1, however the issue reappeared on the trunk. @vitaut
https://godbolt.org/z/8svPsE5Kj

@vitaut vitaut reopened this May 21, 2024
@vitaut
Copy link
Contributor

vitaut commented May 21, 2024

Reopening. We need to bisect.

Arghnews added a commit to Arghnews/fmt that referenced this issue May 21, 2024
Regression introduced in 11f2f30
Already have a test for this, but needed to make __cpp_lib_ranges
smaller to enable it
vitaut pushed a commit that referenced this issue May 23, 2024
Regression introduced in 11f2f30
Already have a test for this, but needed to make __cpp_lib_ranges
smaller to enable it
@vitaut vitaut closed this as completed May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants