The title is already the question.
More details: the standard enacts:
If the enum-key is followed by a nested-name-specifier, the enum-specifier shall refer to an enumeration that was previously declared directly in the class or namespace to which the nested-name-specifier refers (i.e., neither inherited nor introduced by a using-declaration), and the enum-specifier shall appear in a namespace enclosing the previous declaration.
at 7.2, paragraph 4. For example, this prohibits to forward-declare an enum defined inside a class:
struct S{
enum foo{A, B};
};
now, S can be forward-declared, while S::foo not.
Question is about why. Is there a situation in which this rule can be a benefit? Why is it needed? Or, if you prefer: if the standard had not this rule, is there a situation in which the compiler would have a problem? Which one(s)?