[llvm-dev] DenseMap/ValueMap: is M[New]=M[Old] valid ?

Jeroen Dobbelaere via llvm-dev
2019-09-27T09:46:03Z

> From: Martin Storsjö <martin at martin.st>
[...]
> It's not a question about when the operands are evaluated - both do
> evaluate them in the same order. But evaluating the left and right hand
> side leaves you with two references. Then to do the assignment, you
> dereference the right hand side reference and assign it to the
> dereferenced left hand side reference.
[...]
>          GlobalMap[a] = GlobalMap[b];
[...]

Is there a checker in clang that can detect this kind of wrong usage ?
If not, how hard would it be to write one ?

Greetings,

Jeroen Dobbelaere