Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix Issue 9284 - DMD segfaults with templated ctors in constructor de…
…legation
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/ice9284.d(15): Error: template ice9284.C.__ctor does not match any function template declaration. Candidates are: | ||
fail_compilation/ice9284.d(13): ice9284.C.__ctor()(string) | ||
fail_compilation/ice9284.d(15): Error: template ice9284.C.__ctor()(string) cannot deduce template function from argument types !()(int) | ||
fail_compilation/ice9284.d(21): Error: template instance ice9284.C.__ctor!() error instantiating | ||
--- | ||
*/ | ||
|
||
class C | ||
{ | ||
this()(string) | ||
{ | ||
this(10); | ||
// delegating to a constructor which not exists. | ||
} | ||
} | ||
void main() | ||
{ | ||
new C("hello"); | ||
} |