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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Target Milestone|---                         |13.5
   Last reconfirmed|                            |2025-10-08
            Summary|Lambda use of rvalue ref    |[13/14/15/16 Regression]
                   |not considered an lvalue    |Lambda use of rvalue ref
                   |                            |not considered an lvalue
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
4.7.0-4.9.0 used to ICE:
```
<source>: In lambda function:
<source>:8:21: internal compiler error: in cp_build_modify_expr, at
cp/typeck.c:7445
     auto a = [] { r = 2; };
                     ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
```

5,8 produced a slightly different error message:
```
<source>: In lambda function:
<source>:8:21: error: using xvalue (rvalue reference) as lvalue
     auto a = [] { r = 2; };
                     ^
```

6/7 accepted the one with by-reference capature. So that is a regression at
least for that case.

GCC 8 is when the current error message is produced.

Reply via email to