mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-21 15:23:13 +01:00
Fixed consturctors of structs that have invariant
This commit is contained in:
@@ -1615,9 +1615,17 @@ void FuncDeclaration::semantic3(Scope *sc)
|
||||
|
||||
if (type->nextOf()->ty != Tvoid)
|
||||
{
|
||||
#if IN_LLVM
|
||||
Expression *e = 0;
|
||||
if (isCtorDeclaration())
|
||||
e = new VarExp(0, vthis);
|
||||
else
|
||||
e = new VarExp(0, vresult);
|
||||
#else
|
||||
// Create: return vresult;
|
||||
assert(vresult);
|
||||
Expression *e = new VarExp(0, vresult);
|
||||
#endif
|
||||
if (tintro)
|
||||
{ e = e->implicitCastTo(sc, tintro->nextOf());
|
||||
e = e->semantic(sc);
|
||||
|
||||
@@ -3645,7 +3645,11 @@ Statement *ReturnStatement::semantic(Scope *sc)
|
||||
|
||||
if (exp)
|
||||
{
|
||||
#if IN_LLVM
|
||||
if (!fd->isCtorDeclaration() && fd->returnLabel && tbret->ty != Tvoid)
|
||||
#else
|
||||
if (fd->returnLabel && tbret->ty != Tvoid)
|
||||
#endif
|
||||
{
|
||||
assert(fd->vresult);
|
||||
VarExp *v = new VarExp(0, fd->vresult);
|
||||
|
||||
Reference in New Issue
Block a user