-
-
Notifications
You must be signed in to change notification settings - Fork 610
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix Issue 14907 - DMD crash when using template name as a default val…
…ue of template's typed argument
- Loading branch information
Showing
3 changed files
with
53 additions
and
4 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
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/ice14907.d(14): Error: struct ice14907.S(int v = S) recursive template expansion | ||
| fail_compilation/ice14907.d(19): while looking for match for `S!()` | ||
| fail_compilation/ice14907.d(15): Error: template ice14907.f(int v = f)() recursive template expansion | ||
| fail_compilation/ice14907.d(20): while looking for match for `f!()` | ||
| fail_compilation/ice14907.d(15): Error: template ice14907.f(int v = f)() recursive template expansion | ||
| fail_compilation/ice14907.d(21): Error: template `ice14907.f` cannot deduce function from argument types `!()()`, candidates are: | ||
| fail_compilation/ice14907.d(15): `ice14907.f(int v = f)()` | ||
| --- | ||
| */ | ||
|
|
||
| struct S(int v = S) {} | ||
| void f(int v = f)() {} | ||
|
|
||
| void main() | ||
| { | ||
| S!() s; // OK <- ICE | ||
| f!()(); // OK <- ICE | ||
| f(); // OK <- ICE | ||
| } |