https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92944

--- Comment #1 from Ed Catmur <ed at catmur dot uk> ---
This becomes problematic when N::Q is std::hash; we are encouraged not to
reopen namespace std but to specialize std::hash from the root namespace.

Example:

#include <functional>
template<class> constexpr bool P = false;
template<class> constexpr bool Q = false;
template<class T> requires P<T> struct std::hash<T> { std::size_t operator()(T)
{ return 1; } };
template<class U> requires Q<U> struct std::hash<U> { std::size_t operator()(U)
{ return 2; } };
struct S {};
template<> constexpr bool P<S> = true;
int i = std::hash<S>()(S());

clang and MSVC correctly accept this.

Reply via email to