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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jiang An from comment #3)
> See
> - https://cplusplus.github.io/LWG/issue3725
> - https://cplusplus.github.io/LWG/issue3727
> 
> If "implicit expression variations"
> (https://eel.is/c++draft/concepts.equality#6) apply here, then despite
> std::prev returning a non-const prvalue, the behavior of operator-> on such
> a prvalue should be required to be same as that on a const lvalue.

Yes, Hewill just pointed this out to me too.

It does apply here, because the function's constraints have a
requires-expression using a const lvalue operand.

> But the current standard wording just says
> > These implicit expression variations are required to meet the semantic 
> > requirements of the declared expression.
> 
> It seems that we haven't forbidden the cases where an implicit expression
> variation behaves differently while still meeting the semantic requirements.

Meh. That will only affect people intentionally doing dumb things, and we
already spend too much time tweaking the spec to forbid such things, when we
could be doing something more useful.

I think we can close this, the libstdc++ implementation is fine.

Reply via email to