Closed as duplicate of#139067
Closed as duplicate of#139067
Description
Test file, complex.cpp:
#include <complex>
int main(){
return 0;
}
I get
❯ clang++ -stdlib=libstdc++ -std=c++20 complex.cpp
❯ clang++ -stdlib=libstdc++ -std=c++23 complex.cpp
In file included from format.cpp:1:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/15.1.1/../../../../include/c++/15.1.1/complex:50:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/15.1.1/../../../../include/c++/15.1.1/sstream:42:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/15.1.1/../../../../include/c++/15.1.1/istream:43:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/15.1.1/../../../../include/c++/15.1.1/ostream:44:
/usr/lib64/gcc/x86_64-pc-linux-gnu/15.1.1/../../../../include/c++/15.1.1/format:5118:7: error: variable template 'format_kind' declared with deduced type 'const auto' cannot appear in its own initializer
5118 | format_kind<_Rg> // you can specialize this for non-const input ranges
| ^
1 error generated.
❯ g++ -std=c++23 complex.cpp
❯ g++ --version
g++ (GCC) 15.1.1 20250425
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
❯ clang++ --version
clang version 21.0.0git ([email protected]:llvm/llvm-project.git 066bc49f764cb24c8847d83a059684e3b6d7f4da)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/chriselrod/.local/stow/llvm/bin