D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 14545 - can't deprecate default construction
Summary: can't deprecate default construction
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P4 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-04 17:17 UTC by Martin Nowak
Modified: 2024-12-13 18:42 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Martin Nowak 2015-05-04 17:17:01 UTC
cat > enh.d << CODE
struct Foo
{
    deprecated("use foo() instead")
    this();
}
CODE

dmd -c enh

----
Error: constructor enh.Foo.this default constructor for structs only allowed with @disable and no body
----

There is no mean to deprecate default construction of a struct before finally disabling it.
We should enhance the compiler so that the above declaration is valid and using `Foo foo;` would emit a deprecation warning.
Comment 1 dlangBugzillaToGithub 2024-12-13 18:42:42 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/18986

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB