Well, if you are accessing global data with ranges, you are doing it wrong.
Naturally nothing on C++ prevents someone to do that, which is why PVS, Sonar and co exist.
Just like some things aren't prevented by Rust rather clippy.