[Issue 18415] New: Typedef ignores @disabled default constructor
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Feb 11 00:53:52 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18415
Issue ID: 18415
Summary: Typedef ignores @disabled default constructor
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Severity: enhancement
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: simen.kjaras at gmail.com
When a type that has a disabled default constructor is used in
std.typecons.Typedef, it's possible to create an uninitialized instance of the
type, since Typedef doesn't disable its constructor:
unittest {
import std.typecons : Typedef;
struct S {
@disable this();
}
//S s1; // Fails horribly.
Typedef!S s1; // Compiles without issue.
}
--
More information about the Digitalmars-d-bugs
mailing list