[libc-commits] [clang] [libc] Add check in SemaChecking for multiple unsequenced volatile accesses (PR #180955)

Nikita Terentev via libc-commits libc-commits at lists.llvm.org
Fri Oct 30 00:02:48 PDT 2026


================

----------------
Seraphimt wrote:

The code `*func(&i, v) = v;` must cause warning for C and C++ before C++17:
lhs unsequenced rhs => 2 unsequenced read of v.
But non warning for C++17:
lhs sequenced before rhs.
I check and it work correct.

`v = v` don't unsequenced because "updating the stored value of the left operand is sequenced after the value computations of the left and right" => read v sequenced before write v.

https://github.com/llvm/llvm-project/pull/180955


More information about the libc-commits mailing list