A declaration occurs in a scope (3.3); the scope rules are summarized in 3.4. A declaration that declares a
function or defines a class, namespace, template, or function also has one or more scopes nested within it. |
The next line is relevant:
These nested scopes, in turn, can have declarations nested within them. |
7.1.1 lets us know that a static_assert-declaration is a block-declaration. While I can't find anything that specifically says that a block-declaration may only be declared in a block-scope, I can't imagine the choice of names was coincidental.
In line 1 the static_assert is in the global namespace which is essentially an implicit scope that contains all other scopes. block-declarations are legal here.
Line 5: 9.2 specifically allows for a static_assert-declaration here. The declaration has class scope.
Line 10: The static_assert has block scope. Note that labels are the only things which can have function scope.
Line 12: The static_assert has block scope.
Line 18: 7.2 doesn't allow for declarations in an enumerator-list. The term "enumeration scope" only applies to scoped enums.
Line 21: See section 14.1 [temp.param]
Line 23: 3.1.2 lists parameter-declarations and static_assert-declarations as orthogonal entities (which also works for the template parameter type, I would think.)
Also, static_assert doesn't meet the definition of parameter as the standard defines it (1.3.14)
[edit: redundant line removed.]