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

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Jason Merrill from comment #5)
> On further thought, I'm not sure normalizing the dependent form is really
> necessary, either here or for nested-requirements, as long as we get the
> proper SFINAE behavior for the requires-expression.

Well...for a simple constraint like this we don't need to do any additional
normalization, as we already have the normal form of forward_iterator.

But for a constraint with template arguments like, say, same_as<T&>, we do, as
we can can run into the same situation as with non-nested requirements:

template <class Tz> concept is_void = __is_same_as(Tz, void);
template <class Tx, class Ty> concept same_as = __is_same_as (Tx, Ty);
template <class Ta, class Tb> concept void_or_same = is_void<Ta> || same_as<Ta,
Tb>;
template <class T, class Y> concept foo
= requires { { T() } -> void_or_same<Y&>; };
template <class T> void f() requires foo<T,void>;
int main() { f<void>(); }

Here, we need to normalize void_or_same<Dummy,Y&> and then do satisfaction.

Reply via email to