Do not cast away a volatile qualification on a variable type. Casting away the volatile qualification permits the compiler to optimize away operations on the volatile type, consequently negating the use of the volatile keyword in the first place.
...
Noncompliant Code Example
In this example, a volatile object is accessed through a non-volatile-qualified reference, resulting in undefined behavior.
...