Skip to content

Commit

Permalink
Merge pull request #10195 from Basile-z/stable
Browse files Browse the repository at this point in the history
fix issue 19950 - access violation at compile time, possibly via template constraint and alias interaction
merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
  • Loading branch information
dlang-bot committed Jul 19, 2019
2 parents 9f3c29a + 9cd97ab commit f8f8a6c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/dmd/dtemplate.d
Original file line number Diff line number Diff line change
Expand Up @@ -962,12 +962,9 @@ extern (C++) final class TemplateDeclaration : ScopeDsymbol
tf.fargs = fargs;
uint olderrors = global.startGagging();
fd.type = tf.typeSemantic(loc, paramscope);
if (global.endGagging(olderrors))
{
assert(fd.type.ty != Tfunction);
global.endGagging(olderrors);
if (fd.type.ty != Tfunction)
goto Lnomatch;
}
assert(fd.type.ty == Tfunction);
fd.originalType = fd.type; // for mangling
}

Expand Down
13 changes: 13 additions & 0 deletions test/fail_compilation/ice19950.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
TEST_OUTPUT:
---
fail_compilation/ice19950.d(8): Error: undefined identifier `NotHere`
fail_compilation/ice19950.d(9): Error: template instance `ice19950.baz!()` does not match template declaration `baz()(Foo) if (true)`
---
*/
alias Foo = NotHere;
alias Bar = baz!();

void baz()(Foo)
if (true)
{}

0 comments on commit f8f8a6c

Please sign in to comment.