https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81040
Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |WAITING --- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> --- Can't see that clang++ is capable of catching your first test-case: $ clang++ pr81040.cpp -fsanitize=address && ./a.out pr81040.cpp:3:9: warning: expression result unused; assign into a variable to force a volatile load [-Wunused-volatile-lvalue] *(volatile int*)a; ^~~~~~~~~~~~~~~~~ 1 warning generated. $ clang++ --version clang version 4.0.0 (tags/RELEASE_400/final 297347) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /usr/bin