diff dmd/attrib.c @ 1103:b30fe7e1dbb9

- Updated to DMD frontend 1.041. - Removed dmd/inifile.c , it's not under a free license, replaced with libconfig based config file.
author Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
date Thu, 12 Mar 2009 20:37:27 +0100
parents a8cb25d478c4
children 1860414bf3b7
line wrap: on
line diff
--- a/dmd/attrib.c	Thu Mar 12 14:08:57 2009 +0100
+++ b/dmd/attrib.c	Thu Mar 12 20:37:27 2009 +0100
@@ -12,11 +12,7 @@
 #include <stdlib.h>
 #include <assert.h>
 
-#if _WIN32 || IN_GCC || IN_LLVM
-#include "mem.h"
-#elif POSIX
-#include "../root/mem.h"
-#endif
+#include "rmem.h"
 
 #include "init.h"
 #include "declaration.h"
@@ -151,6 +147,14 @@
 {
     //printf("AttribDeclaration::emitComment(sc = %p)\n", sc);
 
+    /* A general problem with this, illustrated by BUGZILLA 2516,
+     * is that attributes are not transmitted through to the underlying
+     * member declarations for template bodies, because semantic analysis
+     * is not done for template declaration bodies
+     * (only template instantiations).
+     * Hence, Ddoc omits attributes from template members.
+     */
+
     Array *d = include(NULL, NULL);
 
     if (d)
@@ -326,11 +330,17 @@
 	{ STCstatic,       TOKstatic },
 	{ STCextern,       TOKextern },
 	{ STCconst,        TOKconst },
+//	{ STCinvariant,    TOKimmutable },
+//	{ STCshared,       TOKshared },
 	{ STCfinal,        TOKfinal },
 	{ STCabstract,     TOKabstract },
 	{ STCsynchronized, TOKsynchronized },
 	{ STCdeprecated,   TOKdeprecated },
 	{ STCoverride,     TOKoverride },
+//	{ STCnothrow,      TOKnothrow },
+//	{ STCpure,         TOKpure },
+//	{ STCref,          TOKref },
+//	{ STCtls,          TOKtls },
     };
 
     int written = 0;
@@ -612,7 +622,7 @@
 
 	sc = sc->push();
 	sc->anonAgg = &aad;
-	sc->stc &= ~(STCauto | STCscope | STCstatic);
+	sc->stc &= ~(STCauto | STCscope | STCstatic | STCtls);
 	sc->inunion = isunion;
 	sc->offset = 0;
 	sc->flags = 0;
@@ -753,6 +763,7 @@
 
 Dsymbol *PragmaDeclaration::syntaxCopy(Dsymbol *s)
 {
+    //printf("PragmaDeclaration::syntaxCopy(%s)\n", toChars());
     PragmaDeclaration *pd;
 
     assert(!s);
@@ -1393,7 +1404,7 @@
 
 int CompileDeclaration::addMember(Scope *sc, ScopeDsymbol *sd, int memnum)
 {
-    //printf("CompileDeclaration::addMember(sc = %p)\n", sc);
+    //printf("CompileDeclaration::addMember(sc = %p, memnum = %d)\n", sc, memnum);
     this->sd = sd;
     if (memnum == 0)
     {	/* No members yet, so parse the mixin now