On 11/13/23 06:50, Jakub Jelinek wrote:
The following patch implements C++26 P2864R2 by emitting pedwarn enabled by
the same options as the C++20 and later warnings (i.e. -Wenum-compare,
-Wdeprecated-enum-enum-conversion and -Wdeprecated-enum-float-conversion
which are all enabled by default). I think we still want to allow users
some option workaround, so am not using directly error, but if that is
what you want instead, I can change it.
I agree, but we also need to return error_mark_node for these cases when
SFINAE, i.e. !(complain & tf_warning_or_error)
enum A { a };
enum B { b };
template <auto X, auto Y> decltype (true ? X : Y) f1();
template <auto X, auto Y> decltype (X + Y) f2();
template <auto X, auto Y> decltype (X | Y) f3();
int main()
{
f1<a, b>(); // OK in C++23, no match in C++26
f2<a, b>(); // same
f3<a, b>(); // same
}
Jason