forked from ldc-developers/ldc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bugzilla 24431 - dmd -vcg-ast crashes printing failed template in…
…… (dlang/dmd!16916)
- Loading branch information
Showing
2 changed files
with
71 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
REQUIRED_ARGS: -vcg-ast -o- | ||
OUTPUT_FILES: compilable/vcg_ast_compilable.d.cg | ||
TEST_OUTPUT: | ||
--- | ||
=== compilable/vcg_ast_compilable.d.cg | ||
import object; | ||
auto binaryFun(E)(E b) | ||
{ | ||
return 'a' == b; | ||
} | ||
void find(Element)(Element needle) if (is(typeof(binaryFun(needle)))) | ||
{ | ||
} | ||
void find()(string needle) | ||
{ | ||
} | ||
void splitter() | ||
{ | ||
find(3); | ||
find(""); | ||
} | ||
binaryFun!int | ||
{ | ||
auto pure nothrow @nogc @safe bool binaryFun(int b) | ||
{ | ||
return 97 == b; | ||
} | ||
} | ||
find!int | ||
{ | ||
pure nothrow @nogc @safe void find(int needle) | ||
{ | ||
} | ||
} | ||
binaryFun!string | ||
{ | ||
auto _error_ binaryFun | ||
{ | ||
__error__ | ||
} | ||
} | ||
find!() | ||
{ | ||
pure nothrow @nogc @safe void find(string needle) | ||
{ | ||
} | ||
} | ||
--- | ||
*/ | ||
|
||
// https://issues.dlang.org/show_bug.cgi?id=24431 | ||
auto binaryFun(E)(E b) | ||
{ | ||
return 'a' == b; | ||
} | ||
|
||
void find(Element)(Element needle) if (is(typeof(binaryFun(needle)))) { } | ||
void find()(string needle) { } | ||
|
||
void splitter() | ||
{ | ||
find!int(3); | ||
find!()(""); | ||
} |