Closed Samuel-Tyler closed 4 years ago
Interestingly, clang10 with -std=c++20 accepts the code.
It's yet another bug in GCC 10. I have reported it to:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95233
I can give my personal experience with GCC 10.1: We tried compiling our work project with it, and it dies due to multiple causes if C++ 20 is enabled. The same code is fine in MSVC, or clang, in C++ 20. And it is fine in GCC 9.3 in C++ 20.
My advice is wait until GCC 10.2, if you want to use C++ 20. Or use any other compiler.
Thanks for reporting the bug however, it's nice to see others have been having the same problem as I.
Ok, thanks for following up!
It's yet another bug in GCC 10.
It's actually a bug in the C++20 draft. GCC was implementing exactly what the draft requires.
I can give my personal experience with GCC 10.1: We tried compiling our work project with it, and it dies due to multiple causes if C++ 20 is enabled. The same code is fine in MSVC, or clang, in C++ 20. And it is fine in GCC 9.3 in C++ 20.
MSVC, Clang and GCC 9.3 do not support <concepts>
and <ranges>
so aren't affected by teething problems in the C++20 spec.
MSVC, Clang and GCC 9.3 do not support
<concepts>
and<ranges>
so aren't affected by teething problems in the C++20 spec.
They will, however benefit from GCC's implementation experience, and the problems found by people using GCC. If everybody followed your advice and used a different compiler, problems wouldn't be found, and would be rediscovered by other compilers later. Nobody benefits from that.
Tested against boost 1.73. Sorry if this has already been fixed somewhere.
The following is failing to compile with gcc10
Error message:
This works fine with -std=c++17 but fails with -std=c++20