Bug 877 – forward references in interdependent template/struct definitions since v1.0

Status
RESOLVED
Resolution
WORKSFORME
Severity
blocker
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2007-01-23T11:08:00Z
Last change time
2014-02-15T13:13:03Z
Keywords
rejects-valid
Assigned to
bugzilla
Creator
manuelk89
Blocks
340

Comments

Comment #0 by manuelk89 — 2007-01-23T11:08:28Z
// a struct S having a pointer to a template instance that itself has // the a value of type S as member: struct T(FOO) { S s; } struct S { T!(int)* pt; } ------ The struct S has a pointer 'pt' to a value of the template type, so the size of 'pt' is known and it should compile. But compiling this with dmd v1.0 gives: A.d:3: struct A.T!(int).T has forward references A.d:9: template instance A.T!(int) error instantiating It compiles well with dmd v0.177 and v0.178. (previous versions untested) It also compiles well with dmd v1.0 if... - you comment out 'S s;' in the template - you write 'S* s;' instead of 'S s;' - make S a class type (ie. 'class S' instead of 'struct S')
Comment #1 by bugzilla — 2007-01-27T19:09:11Z
Works in DMD 1.004
Comment #2 by thomas-dloop — 2007-02-27T10:48:13Z