Your example here is C style though.
struct S { int x; };
is perfectly valid C++
struct S { int x; };
is perfectly valid C++
People have learned to deal with the quirky behavior of the tag name space, but it's still quirky and serves no purpose.
I wrote Bjarne back in the 1980s that the tag name space should be removed from `class` as that wasn't necessary for backwards compatibility with C. He replied no as it would have broken compatibility with existing C++ code.