D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 9701 - UDAs cannot be attached to enum values.
Summary: UDAs cannot be attached to enum values.
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-12 07:14 UTC by simendsjo
Modified: 2021-01-07 14:48 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description simendsjo 2013-03-12 07:14:17 UTC
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 TeddyBear12311 2017-01-20 21:17:37 UTC
What the heck?? 4 years and this hasn't been fixed?!?!?!
Comment 2 Sprink 2017-01-20 22:06:15 UTC
(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 github-bugzilla 2018-06-27 07:06:51 UTC
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 <jacob-carlborg@users.noreply.github.com>
Comment 4 Dlang Bot 2021-01-07 14:48:46 UTC
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