mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-12 06:49:02 +02:00
CTFE: fixed calling of invariant from a constructor
This commit is contained in:
10
dmd2/func.c
10
dmd2/func.c
@@ -1670,10 +1670,14 @@ void FuncDeclaration::semantic3(Scope *sc)
|
||||
{
|
||||
#if IN_LLVM
|
||||
Expression *e = 0;
|
||||
if (isCtorDeclaration())
|
||||
e = new VarExp(0, vthis);
|
||||
else
|
||||
if (isCtorDeclaration()) {
|
||||
ThisExp *te = new ThisExp(0);
|
||||
te->type = vthis->type;
|
||||
te->var = vthis;
|
||||
e = te;
|
||||
} else {
|
||||
e = new VarExp(0, vresult);
|
||||
}
|
||||
#else
|
||||
// Create: return vresult;
|
||||
assert(vresult);
|
||||
|
||||
Reference in New Issue
Block a user