Open Quuxplusone opened 5 years ago
Hmm, are you sure this while_
construct works as expected? It looks as if the return value of body()
in case Flow::CONTINUE:
is entirely discarded. Therefore it's not surprising that when the loop yields "break" on its second iteration it keeps going on instead of actually breaking. Therefore it looks like a true positive on this reduced example.
Oh, wait, i see, the string is also cleared. Let me think a bit more.
Yeah, i see, we always break on the first iteration, nvm. We simply don't realize that a string constructed with a non-empty string literal is non-empty.
The while_ thingy is still suspicious though, i think you should double-check your actual implementation.
We are seeing a false positive from
clang-analyzer-cplusplus.Move
in our code which looks like it is due to incomplete tracking of data dependencies.A somewhat simplified example:
When analyzed this gives
I am seeing this with clang version
44019e8c500fba0cece458d2e44700c967f247c9
(git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@364630 91177308-0d34-0410-b5e6-96231b3b80d8
).