mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-17 17:29:02 +02:00
Merged DMD 2.060 frontend.
Upstream Git tag v2.060 (e8fe11c20249cb9e42538be88c99b74ede4d12e3).
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
|
||||
// Copyright (c) 1999-2011 by Digital Mars
|
||||
// Copyright (c) 1999-2012 by Digital Mars
|
||||
// All Rights Reserved
|
||||
// written by Walter Bright
|
||||
// http://www.digitalmars.com
|
||||
@@ -59,10 +59,14 @@ void StaticAssert::semantic2(Scope *sc)
|
||||
++sc->ignoreTemplates;
|
||||
Expression *e = exp->semantic(sc);
|
||||
sc = sc->pop();
|
||||
if (e->type == Type::terror)
|
||||
if (!e->type->checkBoolean())
|
||||
{
|
||||
if (e->type->toBasetype() != Type::terror)
|
||||
exp->error("expression %s of type %s does not have a boolean value", exp->toChars(), e->type->toChars());
|
||||
return;
|
||||
}
|
||||
unsigned olderrs = global.errors;
|
||||
e = e->optimize(WANTvalue | WANTinterpret);
|
||||
e = e->ctfeInterpret();
|
||||
if (global.errors != olderrs)
|
||||
{
|
||||
errorSupplemental(loc, "while evaluating: static assert(%s)", exp->toChars());
|
||||
@@ -74,7 +78,7 @@ void StaticAssert::semantic2(Scope *sc)
|
||||
OutBuffer buf;
|
||||
|
||||
msg = msg->semantic(sc);
|
||||
msg = msg->optimize(WANTvalue | WANTinterpret);
|
||||
msg = msg->ctfeInterpret();
|
||||
hgs.console = 1;
|
||||
msg->toCBuffer(&buf, &hgs);
|
||||
error("%s", buf.toChars());
|
||||
|
||||
Reference in New Issue
Block a user