Skip to content

Commit

Permalink
fix Issue 14424 - dmd crashes with __traits(getUnitTests)
Browse files Browse the repository at this point in the history
It was necessary to avoid excessive semantic3 with -unittest -inline (see commit 474e0d2), but today compiler incrementally runs semantic3 of the candidate functions for inlining (see commit df11f21). Therefore the hack is not necessary anymore.
  • Loading branch information
9rnsr committed Apr 18, 2015
1 parent 5bad2ac commit cb1b813
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/func.c
Expand Up @@ -5174,9 +5174,6 @@ void UnitTestDeclaration::semantic(Scope *sc)
return;
}

if (inNonRoot())
return;

if (global.params.useUnitTests)
{
if (!type)
Expand Down
13 changes: 13 additions & 0 deletions test/fail_compilation/ice14424.d
@@ -0,0 +1,13 @@
// REQUIRED_ARGS: -o- -unittest
/*
TEST_OUTPUT:
---
fail_compilation/ice14424.d(12): Error: tuple has no effect in expression (tuple(__unittestL3_1))
---
*/

void main()
{
import imports.a14424;
__traits(getUnitTests, imports.a14424);
}
3 changes: 3 additions & 0 deletions test/fail_compilation/imports/a14424.d
@@ -0,0 +1,3 @@
module imports.a14424;

unittest { }

0 comments on commit cb1b813

Please sign in to comment.