[Issue 6564] enum with no initializer compiles

2012-01-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6564


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||yebbl...@gmail.com
 Resolution||INVALID


--- Comment #1 from yebblies yebbl...@gmail.com 2012-01-31 16:59:16 EST ---
enum Length; is a forward declaration to an enum type defined elsewhere.

eg.
--- x.d ---
enum Length
{
 ... members ...
}

--- x.di ---
enum Length;

Not sure this is the greatest thing to allow, but it is correct according to
the spec.  Please open an enhancement request to disallow forward declarations
of enums is you think this is desirable.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6564] enum with no initializer compiles

2012-01-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6564



--- Comment #2 from Andrej Mitrovic andrej.mitrov...@gmail.com 2012-01-30 
22:19:30 PST ---
(In reply to comment #1)
 --- x.di ---
 enum Length;

That's not generated by the compiler (at least not 2.057, I don't know about
2.058 HEAD). But how does it make sense to hide enum members anyway? I've never
seen D code that uses a forward enum declaration.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6564] enum with no initializer compiles

2012-01-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6564



--- Comment #3 from yebblies yebbl...@gmail.com 2012-01-31 17:25:22 EST ---
(In reply to comment #2)
 That's not generated by the compiler (at least not 2.057, I don't know about
 2.058 HEAD).

It doesn't get generated by the compiler, but you can still do it.

 But how does it make sense to hide enum members anyway? 

An enum declaration creates its own type, so in the same kind of places you'd
want to pass around an opaque struct pointer.

 I've never seen D code that uses a forward enum declaration.

Neither have I, but I've seen plenty of C/C++ source that does it. eg dmd

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6564] enum with no initializer compiles

2012-01-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6564



--- Comment #4 from Andrej Mitrovic andrej.mitrov...@gmail.com 2012-01-30 
22:38:43 PST ---
(In reply to comment #3)
 An enum declaration creates its own type, so in the same kind of places you'd
 want to pass around an opaque struct pointer.

Like struct Foo;, I see. I've seen opaque structs before but never opaque
enums. :)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---