We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Reproducer: https://godbolt.org/z/oachhYKcT
#include <iostream> #define FMT_HEADER_ONLY #include <fmt/format.h> using namespace fmt::literals; int main() { auto test = [&](auto a) { return fmt::format("{foo} {bar}", "foo"_a="foo", "bar"_a="bar"); }; std::cout << test(1) << std::endl; return 0; }
Error:
<source>:12:50: error: cannot bind non-const lvalue reference of type 'fmt::v10::detail::named_arg<char, const char (&)[4]>&' to an rvalue of type 'fmt::v10::detail::named_arg<char, const char (&)[4]>' 12 | return fmt::format("{foo} {bar}", "foo"_a="foo", "bar"_a="bar"); | ~~~~~~~^~~~~~
Changing auto a to int a works around the error.
auto a
int a
Is this a GCC bug or a fmtlib bug?
The text was updated successfully, but these errors were encountered:
Looks like a compiler bug to me and it compiles on an earlier gcc version: https://godbolt.org/z/K1on3vYnf. Please report to gcc devs.
Sorry, something went wrong.
reported here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114994
No branches or pull requests
Reproducer: https://godbolt.org/z/oachhYKcT
Error:
Changing
auto a
toint a
works around the error.Is this a GCC bug or a fmtlib bug?
The text was updated successfully, but these errors were encountered: