Description
Example:
template<typename T> consteval T::type f();
... compiled with -std=c++20 -Weverything
produces:
<source>:1:32: warning: use of implicit 'typename' is incompatible with C++ standards before C++20 [-Wc++20-compat]
1 | template<typename T> consteval T::type f();
| ^
<source>:1:22: warning: 'consteval' specifier is incompatible with C++ standards before C++20 [-Wc++20-compat]
1 | template<typename T> consteval T::type f();
| ^
This doesn't make sense: -Wc++XY-compat
is supposed to warn about compatibility issues that would arise when compiling with -std=c++XY
. But that's not what these warnings are about at all!
These warnings should be in -Wpre-c++20-compat
, because they warn about compatibility issues that would arise when compiling with standards earlier than -std=c++20
. It'd be good to do a survey of other -Wc++XY-compat
warnings too, to check for other places we might have got this wrong.