Skip to content

Commit

Permalink
fix Issue 16233 - ICE on wrong code
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Jul 3, 2016
1 parent c24024d commit 5cd44d9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/dtemplate.d
Original file line number Diff line number Diff line change
Expand Up @@ -2087,7 +2087,7 @@ extern (C++) final class TemplateDeclaration : ScopeDsymbol
break;
t = (cast(TypeNext)t).next;
}
if (Dsymbol s = t.toDsymbol(null))
if (Dsymbol s = t.toDsymbol(sc))
{
if (s.isDeprecated())
d.storage_class |= STCdeprecated;
Expand Down
23 changes: 23 additions & 0 deletions test/runnable/xtest46.d
Original file line number Diff line number Diff line change
Expand Up @@ -7848,6 +7848,28 @@ bool test16022()
return type == Type.Colon, type == Type.Comma;
}

/***************************************************/
// https://issues.dlang.org/show_bug.cgi?id=16233

enum valueConvertible(T1, T2) = blah;

struct Checked(T, Hook)
{
bool opEquals(U)(Checked!(U, Hook) rhs)
{
alias R = typeof(payload + rhs.payload);
static if (valueConvertible!(T, R))
{
}
return false;
}
}

void test16233()
{
Checked!(Checked!(int, void), void) x1;
}

/***************************************************/

int main()
Expand Down Expand Up @@ -8164,6 +8186,7 @@ int main()
test15141();
test15369();
test15638();
test16233();

printf("Success\n");
return 0;
Expand Down

0 comments on commit 5cd44d9

Please sign in to comment.