In C++11 a type specifier includes class specifiers and enum specifiers. (aka class definitions and enumeration definitions)
According to the grammar/syntax - type specifiers can appear in several places in the language, but not in all those places are class specifiers and enum specifiers allowed.
For example:
struct C{} c;
// ok: types may be defined in the specifiers of a simple declaration
void f(struct S{});
// error: types may not be defined in parameter types
constexpr auto i = sizeof(enum E{});
// error: types may not be defined in ‘sizeof’ expressions
Where in the standard does it partition these uses of type specifiers into those where types may and may not be defined? For example, where is the rule that says types may not be defined in a sizeof expression?
The reason it can't be found in the C++ standard is because it's actually prohibited in a delta from the C standard.
In C.1.4 we have the following:
Change: Types must be declared in declarations, not in expressions In C, a sizeof expression or cast expression may create a new type.
which shows the prohibition in question.This is explicitly called out in 7.1.6/3:
where the part of particular interest is that
A type-specifier-seq shall not define a class or enumeration unless...