diff dmd/attrib.c @ 876:27a379f288bf

Merged DMD 1.039
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Wed, 07 Jan 2009 19:34:48 +0100
parents 330f999ade44
children a8cb25d478c4
line wrap: on
line diff
--- a/dmd/attrib.c	Tue Jan 06 16:33:51 2009 +0100
+++ b/dmd/attrib.c	Wed Jan 07 19:34:48 2009 +0100
@@ -142,12 +142,6 @@
 {
     //printf("AttribDeclaration::emitComment(sc = %p)\n", sc);
 
-    /* If generating doc comment, skip this because if we're inside
-     * a template, then include(NULL, NULL) will fail.
-     */
-//    if (sc->docbuf)
-//	return;
-
     Array *d = include(NULL, NULL);
 
     if (d)
@@ -1200,6 +1194,17 @@
     {
 	AttribDeclaration::emitComment(sc);
     }
+    else if (sc->docbuf)
+    {
+	/* If generating doc comment, be careful because if we're inside
+	 * a template, then include(NULL, NULL) will fail.
+	 */
+	Array *d = decl ? decl : elsedecl;
+	for (unsigned i = 0; i < d->dim; i++)
+	{   Dsymbol *s = (Dsymbol *)d->data[i];
+	    s->emitComment(sc);
+	}
+    }
 }
 
 // Decide if 'then' or 'else' code should be included