Bug 9701 – UDAs cannot be attached to enum values.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-12T07:14:17Z
Last change time
2021-01-07T14:48:46Z
Assigned to
No Owner
Creator
simendsjo
See also
https://issues.dlang.org/show_bug.cgi?id=9395, https://issues.dlang.org/show_bug.cgi?id=15601

Comments

Comment #0 by simendsjo — 2013-03-12T07:14:17Z
enum E { @(1) v1 } void main() {} $ dmd t t.d(2): Error: basic type expected, not @ t.d(2): Error: type only allowed if anonymous enum and no enum type t.d(2): Error: if type, there must be an initializer t.d(2): Error: found '@' when expecting ',' t.d(2): Error: basic type expected, not ( t.d(2): Error: unexpected ( in declarator t.d(2): Error: basic type expected, not 1 t.d(2): Error: found '1' when expecting ')' t.d(2): Error: type only allowed if anonymous enum and no enum type t.d(2): Error: if type, there must be an initializer t.d(2): Error: found ')' when expecting ','
Comment #1 by TeddyBear12311 — 2017-01-20T21:17:37Z
What the heck?? 4 years and this hasn't been fixed?!?!?!
Comment #2 by sprink.noreply — 2017-01-20T22:06:15Z
(In reply to TeddyBear12311 from comment #1) > What the heck?? 4 years and this hasn't been fixed?!?!?! There was a pull request done a while back, but seems this needs a DIP? https://github.com/dlang/dmd/pull/6161
Comment #3 by github-bugzilla — 2018-06-27T07:06:51Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/36d349c6fffc734ee13b05e6927d1a4a01444a24 Fix Issue 9701 - allow UDAs to be attached to enum values https://github.com/dlang/dmd/commit/972ea45d847518cc2559c596ee198266a6bd3d27 Merge pull request #8404 from IgorStepanov/uda-enum Fix Issue 9701 - allow UDAs to be attached to enum values merged-on-behalf-of: Jacob Carlborg <[email protected]>
Comment #4 by dlang-bot — 2021-01-07T14:48:46Z
dlang/dmd pull request #12108 "[dmd-cxx] Support deprecated, @disable and user-defined attributes on enum members" was merged into dmd-cxx: - b39ef4eda243848cc532bc5352956c129bc3d320 by JinShil: [dmd-cxx] Fix Issue 9701 - allow UDAs to be attached to enum values https://github.com/dlang/dmd/pull/12108