August 04, 2007 [Issue 1401] New: Multiple inheritance of abstract template classes lead to segmentation fault. | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=1401 Summary: Multiple inheritance of abstract template classes lead to segmentation fault. Product: D Version: 2.003 Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: frank-fischer@shadow-soft.de The following code using an abstract template class and multiple inheritance produces a segmentation fault. --- module mytest; import std.stdio; interface A(T) { C!(T) func(); size_t f(); } abstract class B(T): A!(T) { } interface C(T): A!(T) { } class D: B!(int), C!(int) { size_t f() { return 42; } C!(int) func() { return this; } } void main() { A!(int) x = new D(); writefln("%d", x.f()); } --- When I compile this snippet with dmd 2.003 on my linux-box, I get a segmentation fault on the call "x.f()" in the last line. Furthermore, if I use an interface instead of an abstract class for B, everything is fine. Even if I just change the order of definition of 'func' and 'f' in A, i.e. interface A(T) { size_t f(); C!(T) func(); } everything works. -- |
April 23, 2009 [Issue 1401] Multiple inheritance of abstract template classes lead to segmentation fault. | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=1401 gide@nwawudu.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |WORKSFORME ------- Comment #1 from gide@nwawudu.com 2009-04-23 04:17 ------- Works in D2.026. -- |
Copyright © 1999-2021 by the D Language Foundation