Bug 12984 – [REG2.068a] ICE on forward reference of derived class from other instantiated class

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-06-24T19:03:00Z
Last change time
2015-06-17T21:04:00Z
Keywords
ice, pull, rejects-valid
Assigned to
nobody
Creator
nilsbossung

Comments

Comment #0 by nilsbossung — 2014-06-24T19:03:41Z
--- cat > test.d << code template Tpl() {static if(true) enum Tpl = true;} void f()() if(Tpl!()); class B {alias MyD = D!int;} // 4 class C : B {} // 5 class D(T) {alias MyE = E!float;} class E(T) : D!int { void m() { auto c = new C; // 12 f(); // 13 } } code dmd -c -o- test.d --- test.d(2): Error: Cannot interpret Tpl!() at compile time test.d(7): Error: template instance test.E!float error instantiating test.d(4): instantiated from here: D!int --- Works when lines 4 and 5 are swapped. Works when lines 12 and 13 are swapped. Possibly related to issue 12983.
Comment #1 by nilsbossung — 2015-03-30T16:31:44Z
Comment #2 by nilsbossung — 2015-03-30T22:34:11Z
The test case fails again. Segfaults now. The test code can be reduced to this for the segfault: --- cat > test.d << code class B {alias MyD = D!int;} class C : B {} class D(T) {alias MyE = E!float;} class E(T) : D!int { void m() {new C;} } code dmd -c -o- test.d --- Segmentation fault (core dumped) --- (Re-)introduced by https://github.com/D-Programming-Language/dmd/commit/a7bdba471111f09f7dba2fbbc6a3d91d8ba110e7 https://github.com/D-Programming-Language/dmd/pull/4457
Comment #3 by k.hara.pg — 2015-04-01T00:45:33Z
(In reply to Nils from comment #2) > The test case fails again. Segfaults now. > > The test code can be reduced to this for the segfault: > --- > cat > test.d << code > class B {alias MyD = D!int;} > class C : B {} > class D(T) {alias MyE = E!float;} > class E(T) : D!int > { > void m() {new C;} > } > code > dmd -c -o- test.d > --- > Segmentation fault (core dumped) > --- > > (Re-)introduced by > https://github.com/D-Programming-Language/dmd/commit/ > a7bdba471111f09f7dba2fbbc6a3d91d8ba110e7 > https://github.com/D-Programming-Language/dmd/pull/4457 https://github.com/D-Programming-Language/dmd/pull/4537
Comment #4 by github-bugzilla — 2015-04-01T03:30:01Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/ec6df46675f8de0110c6cdc7a85d4066310a91fa fix Issue 12984 - ICE on forward reference of derived class from other instantiated class https://github.com/D-Programming-Language/dmd/commit/2a83a40246dee806b04465bd424d41ac9f78349f Merge pull request #4537 from 9rnsr/fix12984 [REG2.068a] Issue 12984 - ICE on forward reference of derived class from other instantiated class
Comment #5 by github-bugzilla — 2015-04-01T11:56:19Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/302d42186a30452ddb0c7bd02f4f8c682a8f4c93 [Fix] Fix incorrect test for issue 12984. Causing commit: 8efa502a209c64a75f682956cab0b3647737c614.
Comment #6 by github-bugzilla — 2015-06-17T21:04:00Z