Commit 0aec648
committed
Fix #13628 FP: accessMoved with ternary
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 21de4fa commit 0aec648
2 files changed
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3296 | 3296 | | |
3297 | 3297 | | |
3298 | 3298 | | |
3299 | | - | |
| 3299 | + | |
3300 | 3300 | | |
| 3301 | + | |
| 3302 | + | |
| 3303 | + | |
| 3304 | + | |
| 3305 | + | |
| 3306 | + | |
| 3307 | + | |
| 3308 | + | |
3301 | 3309 | | |
3302 | 3310 | | |
3303 | 3311 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12861 | 12861 | | |
12862 | 12862 | | |
12863 | 12863 | | |
| 12864 | + | |
| 12865 | + | |
| 12866 | + | |
| 12867 | + | |
| 12868 | + | |
| 12869 | + | |
| 12870 | + | |
| 12871 | + | |
| 12872 | + | |
| 12873 | + | |
| 12874 | + | |
| 12875 | + | |
12864 | 12876 | | |
12865 | 12877 | | |
12866 | 12878 | | |
| |||
0 commit comments