https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122824
--- Comment #2 from d7d1cd <d7d1cd at mail dot ru> ---
(In reply to Andrew Pinski from comment #1)
> can you reproduce the warning without modules?
> Second please don't just link again to godbolt and provide the source
> attached?
Yes, it's pretty easy. Here's the source code:
$ cat source.cc
#include <format>
template <typename... Args>
auto foo(std::format_string<Args...> && format, Args &&... args) {
return std::format(std::move(format), std::forward<Args>(args)...);
}
int main() {
auto a = foo("{}", 42);
}
(In reply to Andrew Pinski from comment #1)
> please produce the exact command line sequence of gcc invocations that is
> causing the failure
Compiling the above code produces warnings. The command line for compiling with
GCC trunk is:
g++ -std=c++23 -Wall -Werror -O2 source.cc
Here's a playback in the online compiler: https://godbolt.org/z/KnWKKT3x8