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
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/175b9129a0293667371027fa68b85d9e7c78754e fixed issue 15639 https://github.com/D-Programming-Language/phobos/commit/3edc09dfa4d4e6223409316d2dcde6d3fdec7066 Merge pull request #4023 from BBasile/ussue-15639 fixed issue 15639 - allocator.make enables abstract class instantiation