Commit 93bc251
authored
Fix #13628 FP: accessMoved with ternary (#8645)
When std::move(x) is only in the true branch of a ternary operator,
endOfFunctionCall was left pointing at the first token of the false
branch, causing valueFlowForward to tag it as always-moved and report a
spurious warning on the ? token.
Fix by advancing past the entire false-branch subtree using
nextAfterAstRightmostLeaf before starting propagation.
---------
Signed-off-by: Francois Berder <fberder@outlook.fr>1 parent 2538dcd commit 93bc251
2 files changed
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3296 | 3296 | | |
3297 | 3297 | | |
3298 | 3298 | | |
3299 | | - | |
3300 | | - | |
| 3299 | + | |
| 3300 | + | |
| 3301 | + | |
| 3302 | + | |
| 3303 | + | |
3301 | 3304 | | |
3302 | 3305 | | |
3303 | 3306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12866 | 12866 | | |
12867 | 12867 | | |
12868 | 12868 | | |
| 12869 | + | |
| 12870 | + | |
| 12871 | + | |
| 12872 | + | |
| 12873 | + | |
| 12874 | + | |
| 12875 | + | |
| 12876 | + | |
| 12877 | + | |
| 12878 | + | |
| 12879 | + | |
| 12880 | + | |
12869 | 12881 | | |
12870 | 12882 | | |
12871 | 12883 | | |
| |||
0 commit comments