Bug 15639 – std.experimental.allocator enables abstract class instantiation
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-02-02T12:21:06Z
Last change time
2020-03-21T03:56:39Z
Assigned to
No Owner
Creator
Olivier Pisano
Comments
Comment #0 by olivier.pisano — 2016-02-02T12:21:06Z
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
}
Comment #1 by github-bugzilla — 2016-03-04T23:03:45Z