diff dmd/func.c @ 658:50383e476c7e

Upgraded frontend to DMD 1.035
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Mon, 06 Oct 2008 16:22:11 +0200
parents 49466efd4fba
children eef8ac26c66c
line wrap: on
line diff
--- a/dmd/func.c	Mon Oct 06 14:37:00 2008 +0200
+++ b/dmd/func.c	Mon Oct 06 16:22:11 2008 +0200
@@ -140,6 +140,9 @@
     //printf("function storage_class = x%x\n", storage_class);
     Dsymbol *parent = toParent();
 
+    if (ident == Id::ctor && !isCtorDeclaration())
+	error("_ctor is reserved for constructors");
+
     if (isConst() || isAuto() || isScope())
 	error("functions cannot be const or auto");
 
@@ -2543,7 +2546,7 @@
 	sa->push(s);
 	Expression *e = new IdentifierExp(0, id);
 	e = new AddAssignExp(0, e, new IntegerExp(-1));
-	e = new EqualExp(TOKnotequal, 0, e, new IntegerExp(1));
+	e = new EqualExp(TOKnotequal, 0, e, new IntegerExp(0));
 	s = new IfStatement(0, NULL, e, new ReturnStatement(0, NULL), NULL);
 	sa->push(s);
 	if (fbody)