Mercurial > projects > ldc
comparison dmd2/staticassert.c @ 1452:638d16625da2
LDC 2 compiles again.
author | Robert Clipsham <robert@octarineparrot.com> |
---|---|
date | Sat, 30 May 2009 17:23:32 +0100 |
parents | f04dde6e882c |
children |
comparison
equal
deleted
inserted
replaced
1423:42bd767ec5a4 | 1452:638d16625da2 |
---|---|
16 #include "expression.h" | 16 #include "expression.h" |
17 #include "id.h" | 17 #include "id.h" |
18 #include "hdrgen.h" | 18 #include "hdrgen.h" |
19 #include "scope.h" | 19 #include "scope.h" |
20 #include "template.h" | 20 #include "template.h" |
21 | |
21 | 22 |
22 /********************************* AttribDeclaration ****************************/ | 23 /********************************* AttribDeclaration ****************************/ |
23 | 24 |
24 StaticAssert::StaticAssert(Loc loc, Expression *exp, Expression *msg) | 25 StaticAssert::StaticAssert(Loc loc, Expression *exp, Expression *msg) |
25 : Dsymbol(Id::empty) | 26 : Dsymbol(Id::empty) |
45 | 46 |
46 void StaticAssert::semantic(Scope *sc) | 47 void StaticAssert::semantic(Scope *sc) |
47 { | 48 { |
48 } | 49 } |
49 | 50 |
51 #include "scope.h" | |
52 #include "template.h" | |
53 #include "declaration.h" | |
54 | |
50 void StaticAssert::semantic2(Scope *sc) | 55 void StaticAssert::semantic2(Scope *sc) |
51 { | 56 { |
52 Expression *e; | 57 Expression *e; |
53 | 58 |
54 //printf("StaticAssert::semantic2() %s\n", toChars()); | 59 //printf("StaticAssert::semantic2() %s\n", toChars()); |
65 hgs.console = 1; | 70 hgs.console = 1; |
66 msg->toCBuffer(&buf, &hgs); | 71 msg->toCBuffer(&buf, &hgs); |
67 error("%s", buf.toChars()); | 72 error("%s", buf.toChars()); |
68 } | 73 } |
69 else | 74 else |
70 error("is false"); | 75 error("(%s) is false", exp->toChars()); |
71 if(sc->tinst) | 76 if(sc->tinst) |
72 sc->tinst->printInstantiationTrace(); | 77 sc->tinst->printInstantiationTrace(); |
73 if (!global.gag) | 78 if (!global.gag) { |
74 fatal(); | 79 fatal(); |
80 } | |
75 } | 81 } |
76 else if (!e->isBool(TRUE)) | 82 else if (!e->isBool(TRUE)) |
77 { | 83 { |
78 error("(%s) is not evaluatable at compile time", exp->toChars()); | 84 error("(%s) is not evaluatable at compile time", exp->toChars()); |
79 } | 85 } |