Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix Issue 14267 - ICE when determining if a function can be inlined
- Loading branch information
Showing
3 changed files
with
64 additions
and
5 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,19 @@ | ||
module imports.a14267; | ||
|
||
struct SysTime14267 | ||
{ | ||
// semantic() is called twice, and its scope is wrongly set to NULL | ||
// at the second call. | ||
this(long stdTime) {} | ||
this(this) {} | ||
~this() {} | ||
|
||
static SysTime14267 min() | ||
{ | ||
// inlining this function will call the semantic3() of SysTime14267 constructor. | ||
// but its 'scope' field is NULL so unintentionally semantic3() call fails. | ||
auto st = SysTime14267(long.min); | ||
auto st2 = st; | ||
return st2; | ||
} | ||
} |
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