Test case:
------------------------
struct T {
E e;
public // <-- comment this out is OK.
enum E { x }
}
------------------------
x.d(5): Error: enum E is forward referenced
x.d(5): Error: enum E is forward referenced
------------------------
This applies to *all* kinds of attributes, like 'deprecated' or 'static' or '@safe'. The T can be changed to any kinds of aggregates (class, interface, union) and the bug still persists.
Moving the 'E e;' below the 'enum E' removes the error, so is not using any attributes.