digitalmars.D - compiler bug?
- Ant^2i (13/13) Jul 04 2005 Ok, below code doesn't work.
- Stewart Gordon (8/23) Jul 06 2005 Is this the exact wording of an error message? Or your speculation of
- Greg Smith (9/20) Jul 08 2005 I get 'a.d(6): struct Node no size yet for forward reference'.
- Stewart Gordon (14/24) Jul 11 2005 Just because it doesn't crash GDC doesn't mean it doesn't crash DMD.
Ok, below code doesn't work. class Foo(T) { Node sentinel; // using Node before it's definition crashes compiler? struct Node { T value; // it seems that template's T have something to do with it } } void main() { Foo!(int) bar=new Foo!(int); // compiler can't create new class }
Jul 04 2005
Ant^2i wrote:Ok, below code doesn't work. class Foo(T) { Node sentinel; // using Node before it's definition crashes compiler?That any code crashes the compiler is a bug.struct Node { T value; // it seems that template's T have something to do with it } } void main() { Foo!(int) bar=new Foo!(int); // compiler can't create new class }Is this the exact wording of an error message? Or your speculation of what's triggering the crash? Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Jul 06 2005
Ant^2i wrote:Ok, below code doesn't work. class Foo(T) { Node sentinel; // using Node before it's definition crashes compiler? struct Node { T value; // it seems that template's T have something to do with it } }I get 'a.d(6): struct Node no size yet for forward reference'. Running "gdc (GCC) 3.3.3 (cygwin special)" When you say 'crashes the compiler', do you mean 'the compiler prints an error message about the source code, and exits?' If so, that's not a 'crash'. Don't confuse people by saying it is. Say what happened. And what version you're running. On what. If not, pardon me; but it happens a lot. And you should still say what happened.
Jul 08 2005
Greg Smith wrote: <snip>I get 'a.d(6): struct Node no size yet for forward reference'. Running "gdc (GCC) 3.3.3 (cygwin special)" When you say 'crashes the compiler', do you mean 'the compiler prints an error message about the source code, and exits?'Just because it doesn't crash GDC doesn't mean it doesn't crash DMD.If so, that's not a 'crash'. Don't confuse people by saying it is. Say what happened. And what version you're running. On what. If not, pardon me; but it happens a lot. And you should still say what happened.True. But I wouldn't call it fair to speculate that the OP's misusing the word "crash" in this instance. Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- a->--- UB P+ L E W++ N+++ o K- w++ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Jul 11 2005