Currently the checker for unsequenced operations is not able to see through members and references. For example the following code is not detected:
struct S { unsigned x; } s; s.x + s.x++;
Improve this by teaching the unsequenced operation checker about references, members (including static members) and structured bindings. To do this introduce a class MemoryLocation which will approximate C++ memory locations. Then modify the method getObject (renamed to getMemoryLocation) to follow references, handle members and look through bindings. Also update the diagnostic messages.
With this patch the sequence checker do not handle bit-fields in any particular way, but ideally we should take into account that two distinct bit-fields can be in the same memory location. This is marked as TODO.
I wonder if we could just print out a simple access path here (eg x.a[3]). APValue has support for representing and pretty-printing such things already, and you could try passing arbitrary lvalue expressions to the constant evaluator to try to form them rather than special-casing a few things in getMemoryLocationImpl.