[Issue 15639] New: std.experimental.allocator enables abstract class instantiation
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Feb 2 04:21:06 PST 2016
https://issues.dlang.org/show_bug.cgi?id=15639
Issue ID: 15639
Summary: std.experimental.allocator enables abstract class
instantiation
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: major
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: olivier.pisano at laposte.net
With std.experimental.allocator.make, one can instantiate an abstract class.
Calling an abstract method segfaults.
Tested with both 2.069.2 and 2.070.
import std.experimental.allocator;
import std.stdio;
abstract class Toto
{
void f()
{
writeln("f() called");
}
abstract void g();
}
void main()
{
auto toto = theAllocator.make!Toto();
toto.f(); // prints "f() called"
toto.g(); // segfaults
}
--
More information about the Digitalmars-d-bugs
mailing list