https://issues.dlang.org/show_bug.cgi?id=22565
--- Comment #3 from RazvanN <razvan.nitu1...@gmail.com> --- Ok, I was hasty in my judgement, however, I think that empty declarations are there just to have symmetry with empty statements (as you cannot have statements at top level), still I don't see any point in allowing attaching a UDA to an empty declaration. To be more precise, UDA's are attached to symbols (that are indeed introduced by declarations). As far as I could tell you cannot attach a UDA to an anonymous function or an anonymous class, specifically because it does not have a name. I guess we can modify the spec to specifically mention that UDAs must be applied to a symbol. --