Bug 8802 – Problem with enums of void*

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2012-10-11T10:09:00Z
Last change time
2012-12-02T18:47:26Z
Keywords
pull, rejects-valid
Assigned to
andrej.mitrovich
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2012-10-11T10:09:32Z
Problem found by Lubos Pintes: http://forum.dlang.org/thread/[email protected] enum Foo : void* { a = null } void main() { auto f = Foo.a; } DMD 2.061alpha gives: temp.d(5): Error: no property 'a' for type 'void'
Comment #1 by andrej.mitrovich — 2012-11-27T15:58:45Z
Note that there's another separate and unrelated bug here, you can't compile this with -g. D:\dev\code\d_code>dmd -g test.d test.d(4): Error: Integer constant expression expected instead of null test.d(4): Error: Integer constant expression expected instead of null I'm not sure if this is filed yet.
Comment #2 by andrej.mitrovich — 2012-11-27T16:26:32Z
Comment #3 by bearophile_hugs — 2012-11-27T16:52:25Z
(In reply to comment #1) > I'm not sure if this is filed yet. I think that's already in Bugzilla (not filed by me).
Comment #4 by r.sagitario — 2012-11-27T22:33:14Z
(In reply to comment #1) > Note that there's another separate and unrelated bug here, you can't compile > this with -g. > > D:\dev\code\d_code>dmd -g test.d > test.d(4): Error: Integer constant expression expected instead of null > test.d(4): Error: Integer constant expression expected instead of null > > I'm not sure if this is filed yet. This is issue 5168.
Comment #5 by github-bugzilla — 2012-12-02T17:20:19Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/bfd3af86dca2a4a1c0efb533a874812ca33ac515 Fix Issue 8802 - proplem with enum of void* https://github.com/D-Programming-Language/dmd/commit/c377a6451302e3bfd8cf74e72b34ca64642fb45a Merge pull request #1330 from AndrejMitrovic/Fix8802 Issue 8802 - Lookup problem with void* enum base type