comparison dmd/func.c @ 35:3cfcb944304e trunk

[svn r39] * Updated to DMD 1.022 with the exception of: Bugzilla 278: dmd.conf search path doesn't work This fix was causing crashes for me :/ So for it's the old behaviour
author lindquist
date Tue, 09 Oct 2007 06:21:30 +0200
parents 788401029ecf
children 6fcc08a4d406
comparison
equal deleted inserted replaced
34:4648206ca213 35:3cfcb944304e
927 if (isStaticCtorDeclaration()) 927 if (isStaticCtorDeclaration())
928 { /* It's a static constructor. Ensure that all 928 { /* It's a static constructor. Ensure that all
929 * ctor consts were initialized. 929 * ctor consts were initialized.
930 */ 930 */
931 931
932 ScopeDsymbol *ad = toParent()->isScopeDsymbol(); 932 Dsymbol *p = toParent();
933 assert(ad); 933 ScopeDsymbol *ad = p->isScopeDsymbol();
934 for (int i = 0; i < ad->members->dim; i++) 934 if (!ad)
935 { Dsymbol *s = (Dsymbol *)ad->members->data[i]; 935 {
936 936 error("static constructor can only be member of struct/class/module, not %s %s", p->kind(), p->toChars());
937 s->checkCtorConstInit(); 937 }
938 else
939 {
940 for (int i = 0; i < ad->members->dim; i++)
941 { Dsymbol *s = (Dsymbol *)ad->members->data[i];
942
943 s->checkCtorConstInit();
944 }
938 } 945 }
939 } 946 }
940 947
941 if (isCtorDeclaration() && cd) 948 if (isCtorDeclaration() && cd)
942 { 949 {
2247 } 2254 }
2248 2255
2249 void StaticCtorDeclaration::toCBuffer(OutBuffer *buf, HdrGenState *hgs) 2256 void StaticCtorDeclaration::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
2250 { 2257 {
2251 if (hgs->hdrgen) 2258 if (hgs->hdrgen)
2252 { buf->writestring("static this(){}\n"); 2259 { buf->writestring("static this();\n");
2253 return; 2260 return;
2254 } 2261 }
2255 buf->writestring("static this()"); 2262 buf->writestring("static this()");
2256 bodyToCBuffer(buf, hgs); 2263 bodyToCBuffer(buf, hgs);
2257 } 2264 }