mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Merged DMD commit c7f94c6b66d3b4233ea01dd3dd9f0028b7118870:
5349 ICE(toir.c): nested class in static member function When checking if a nested class can reach a parent class, it should not be possible to jump through static functions. Static member functions were just being silently ignored, which meant nonsense was passed to the backend. (Didn't always cause an ICE, sometimes generates nonsense code).
This commit is contained in:
@@ -128,6 +128,14 @@ Expression *getRightThis(Loc loc, Scope *sc, AggregateDeclaration *ad,
|
||||
|
||||
e1 = new VarExp(loc, f->vthis);
|
||||
}
|
||||
else
|
||||
{
|
||||
e1->error("need 'this' of type %s to access member %s"
|
||||
" from static function %s",
|
||||
ad->toChars(), var->toChars(), f->toChars());
|
||||
e1 = new ErrorExp();
|
||||
return e1;
|
||||
}
|
||||
}
|
||||
if (s && s->isClassDeclaration())
|
||||
{ e1->type = s->isClassDeclaration()->type;
|
||||
|
||||
Reference in New Issue
Block a user