diff options
Diffstat (limited to 'gcc/d/dmd/staticassert.c')
-rw-r--r-- | gcc/d/dmd/staticassert.c | 49 |
1 files changed, 1 insertions, 48 deletions
diff --git a/gcc/d/dmd/staticassert.c b/gcc/d/dmd/staticassert.c index 57181cd..c2d0f5b 100644 --- a/gcc/d/dmd/staticassert.c +++ b/gcc/d/dmd/staticassert.c @@ -1,6 +1,6 @@ /* Compiler implementation of the D programming language - * Copyright (C) 1999-2020 by The D Language Foundation, All Rights Reserved + * Copyright (C) 1999-2021 by The D Language Foundation, All Rights Reserved * written by Walter Bright * http://www.digitalmars.com * Distributed under the Boost Software License, Version 1.0. @@ -19,7 +19,6 @@ #include "template.h" #include "declaration.h" -Expression *semantic(Expression *e, Scope *sc); bool evalStaticCondition(Scope *sc, Expression *exp, Expression *e, bool &errors); /********************************* AttribDeclaration ****************************/ @@ -43,52 +42,6 @@ void StaticAssert::addMember(Scope *, ScopeDsymbol *) // we didn't add anything } -void StaticAssert::semantic(Scope *) -{ -} - -void StaticAssert::semantic2(Scope *sc) -{ - //printf("StaticAssert::semantic2() %s\n", toChars()); - ScopeDsymbol *sds = new ScopeDsymbol(); - sc = sc->push(sds); - sc->tinst = NULL; - sc->minst = NULL; - - bool errors = false; - bool result = evalStaticCondition(sc, exp, exp, errors); - sc = sc->pop(); - if (errors) - { - errorSupplemental(loc, "while evaluating: static assert(%s)", exp->toChars()); - } - else if (!result) - { - if (msg) - { - sc = sc->startCTFE(); - msg = ::semantic(msg, sc); - msg = resolveProperties(sc, msg); - sc = sc->endCTFE(); - msg = msg->ctfeInterpret(); - if (StringExp * se = msg->toStringExp()) - { - // same with pragma(msg) - se = se->toUTF8(sc); - error("\"%.*s\"", (int)se->len, (char *)se->string); - } - else - error("%s", msg->toChars()); - } - else - error("(%s) is false", exp->toChars()); - if (sc->tinst) - sc->tinst->printInstantiationTrace(); - if (!global.gag) - fatal(); - } -} - bool StaticAssert::oneMember(Dsymbol **ps, Identifier *) { //printf("StaticAssert::oneMember())\n"); |