Understanding volatile class fields in AVR C++ programs
I would just like to point out that pjc50 actually answered a different question, relating to synchronization and atomic operations, which is completely orthogonal to the issue of whether variables should be marked volatile for the compiler.

volatile is no different in C++ than it is in C &mdash; the compiler does not have global knowledge about how variables are used, and cannot in general figure out on its own which ones might be shared among multiple threads. Keep in mind that the modules used in these threads might be separately compiled.