As far as I can see in the standard, the following code is valid. It compiles in MSVC1025.
const struct omg;
struct omg volatile;
int main()
{
return 0;
}
The qualifiers const
and volatile
seem purposeless in those declarations. They do not help nor hurt neither the compiler nor the programmer.
The standard does not seem bent on weeding out these "empty ambiguities". In the case of the empty declaration ;
, it is explicitly allowed.
Are there other cases of tokens that, after preprocessing, are irrelevant for the meaning of the expression?