diff --git a/dmd/link.c b/dmd/link.c index 2a2342a9f5..b81427df6c 100644 --- a/dmd/link.c +++ b/dmd/link.c @@ -32,6 +32,8 @@ #include "mem.h" +#include "gen/logger.h" + int executecmd(char *cmd, char *args, int useenv); int executearg0(char *cmd, char *args); @@ -41,6 +43,8 @@ int executearg0(char *cmd, char *args); int runLINK() { + Logger::println("*** Linking executable ***"); + #if _WIN32 assert(0 && "linking not done for win32"); @@ -321,7 +325,7 @@ int runLINK() printf("--- errorlevel %d\n", status); return status; #else - printf ("Linking is not yet supported for this version of LLVMDMD.\n"); + printf ("Linking is not yet supported for this version of LLVMDC.\n"); return -1; #endif } diff --git a/gen/classes.cpp b/gen/classes.cpp index 6817fb6405..e48da2b982 100644 --- a/gen/classes.cpp +++ b/gen/classes.cpp @@ -793,8 +793,11 @@ DValue* DtoNewClass(TypeClass* tc, NewExp* newexp) } // call constructor - if (newexp->arguments) + if (newexp->member) + { + assert(newexp->arguments != NULL); return DtoCallClassCtor(tc, newexp->member, newexp->arguments, mem); + } // return default constructed class return new DImValue(tc, mem, false); diff --git a/gen/tollvm.cpp b/gen/tollvm.cpp index 13ca4ac7b5..85290f6daf 100644 --- a/gen/tollvm.cpp +++ b/gen/tollvm.cpp @@ -1628,6 +1628,7 @@ void DtoConstInitGlobal(VarDeclaration* vd) _type = _init->getType(); llvm::cast(gIR->irDsymbol[vd].irGlobal->type.get())->refineAbstractTypeTo(_type); _type = gIR->irDsymbol[vd].irGlobal->type.get(); + //_type->dump(); assert(!_type->isAbstract()); llvm::GlobalVariable* gvar = llvm::cast(gIR->irDsymbol[vd].irGlobal->value); diff --git a/llvmdc.kdevelop.filelist b/llvmdc.kdevelop.filelist index c3d4731852..f550c48edb 100644 --- a/llvmdc.kdevelop.filelist +++ b/llvmdc.kdevelop.filelist @@ -749,6 +749,7 @@ tangotests tangotests/a.d tangotests/b.d tangotests/c.d +tangotests/constructors.d tangotests/d.d tangotests/e.d tangotests/f.d diff --git a/tangotests/constructors.d b/tangotests/constructors.d new file mode 100644 index 0000000000..fa7b05dcc1 --- /dev/null +++ b/tangotests/constructors.d @@ -0,0 +1,29 @@ +import tango.io.Console; + +class C +{ + this() + { + Cout("C()").newline; + } + this(char[] str) + { + Cout("C(")(str)(")").newline; + } +} + +class D : C +{ + this() + { + super("D"); + Cout("D()").newline; + } +} + +void main() +{ + auto c1 = new C(); + auto c2 = new C("C"); + auto d = new D(); +}