-
-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5055 from 9rnsr/fix15021
[REG2.068.1] Issue 15021 - linker error with speculative instantiation and -inline
- Loading branch information
Showing
5 changed files
with
58 additions
and
2 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,13 @@ | ||
| module imports.std15021conv; | ||
|
|
||
| T to(T, A...)(A args) | ||
| { | ||
| return toImpl!T(args); | ||
| } | ||
|
|
||
| T toImpl(T, S)(S value) | ||
| { | ||
| import imports.std15021format; | ||
| enforceValidFormatSpec!(S, char)('c'); | ||
| return ""; | ||
| } |
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,12 @@ | ||
| module imports.std15021format; | ||
|
|
||
| T enforceEx(T)(T value, lazy string msg = "") | ||
| { | ||
| if (!value) throw new Exception(msg); | ||
| return value; | ||
| } | ||
|
|
||
| void enforceValidFormatSpec(T, Char)(int spec) | ||
| { | ||
| enforceEx(spec == 's'); | ||
| } |
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,18 @@ | ||
| // PERMUTE_ARGS: -inline -g -debug -unittest | ||
|
|
||
| import imports.std15021conv; | ||
|
|
||
| class AliasDecl {} | ||
|
|
||
| void aliasDecl(AliasDecl ad) | ||
| { | ||
| AliasDecl* zis; | ||
|
|
||
| static if (is(typeof(to!string(*zis)))) | ||
| { | ||
| pragma(msg, "hit!"); | ||
| to!string(*zis); | ||
| } | ||
| } | ||
|
|
||
| void main() {} |