D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 8115 - Templated default constructor not called
Summary: Templated default constructor not called
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 major
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-18 15:28 UTC by dlang+issues
Modified: 2022-12-01 13:33 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description dlang+issues 2012-05-18 15:28:03 UTC
struct S { this(A...)(A) { static assert(0, "It compiles?!"); } }
void main() { auto s = S(); }
Comment 1 Alexey Kulentsov 2017-03-19 22:01:16 UTC
templated constructor this(A...)(A) is not matched for empty argument list, for both structs and classes, tested on DMD64 D Compiler v2.073.0
Comment 2 RazvanN 2022-12-01 13:33:48 UTC
Default constructors are not allowed for structs, therefore the templated one is only going to get matched once you provide at least one argument. This is the correct behavior.