volatile
can be used to qualify many objects in C and C++, but only a few of the possible places have a well-defined meaning (global
variables and local variables, for instance). There is no well-defined meaning to the use of volatile
to qualify a function return type
or a function parameter. Furthermore, for structured bindings, the volatile
qualifier appertains to the decomposed object, which cannot
be referred to. Since C++20, these uses are deprecated, but even before, you should not use volatile in those places.
This rule raises an issue for a volatile qualified function return type, function parameter, and structured binding (available in C++ since
C++17).
Noncompliant code example
int volatile f(int volatile i); // Noncompliant, both for the return type and the parameter
void g() {
auto volatile [a, b] = getPair(); // Noncompliant
}