Commit 4073a79
committed
c++: capture folding and lvalueness checking [PR125408]
Here after the recursive mark_rvalue_use we end up with a VAR_DECL in r, so
the assert fails. But in that case r is still an lvalue, so we don't need
to do any adjustment.
Fixed by adjusting the condition to detect the case we actually need to fix
up, i.e. when ref is an lvalue and r is not. The previous !rvalue_p
condition doesn't make much sense; rvalue_p indicates whether we want to do
an lvalue-rvalue conversion on expr, not whether expr was already an rvalue.
PR c++/125408
gcc/cp/ChangeLog:
* expr.cc (mark_use): Fix condition for changing rvalue to lvalue.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/lambda-targ34.C: New test.1 parent 41006b6 commit 4073a79
2 files changed
Lines changed: 32 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
0 commit comments