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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
For the original example, clang says what's wrong:

arrow.cc:14:7: error: no viable overloaded 'operator->'
   14 |   iter->i;
      |   ~~~~^
arrow.cc:6:8: note: candidate function not viable: constraints not satisfied
    6 |   auto operator->() const requires(t.operator->()) { return
t.operator->(); }
      |        ^
arrow.cc:6:38: note: because substituted constraint expression is ill-formed:
no member named 'operator->' in 'S'
    6 |   auto operator->() const requires(t.operator->()) { return
t.operator->(); }
      |                                      ^
1 error generated.


But EDG has the same problem as GCC:

"arrow.cc", line 14: error: operator -> or ->* applied to "Iter<S>" instead of
          to a pointer type
    iter->i;
    ^

"arrow.cc", line 14: warning: variable "iter" is used before its value is set
    iter->i;
    ^

1 error detected in the compilation of "arrow.cc".

Reply via email to