Bug 99 – superfluous output for failed static asserts
Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P4
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2006-04-11T01:52:00Z
Last change time
2014-02-15T02:08:30Z
Assigned to
bugzilla
Creator
thomas-dloop
Comments
Comment #0 by thomas-dloop — 2006-04-11T01:52:06Z
== source.d ==
int i;
static assert(i);
>dmd -c source.d
source.d(2): static assert (i) is not evaluatable at compile time
i
Note the superfluous i in the second line.
Cause:
diff -urBb /opt/dmd/0.151/src/dmd/staticassert.c /opt/dmd/0.153/src/dmd/staticassert.c
--- /opt/dmd/0.151/src/dmd/staticassert.c
+++ /opt/dmd/0.153/src/dmd/staticassert.c
@@ -51,7 +51,10 @@
if (e->isBool(FALSE))
error("(%s) is false", exp->toChars());
else if (!e->isBool(TRUE))
+ {
error("(%s) is not evaluatable at compile time", exp->toChars());
+printf("%s\n", e->toChars());
+ }
}
int StaticAssert::oneMember(Dsymbol **ps)
Comment #1 by clugdbug — 2006-06-01T05:24:29Z
This seems to be fixed. It works OK in DMD 0.158 Windows, and the bad line in staticassert.c is gone. Please confirm.
(In reply to comment #0)
> == source.d ==
> int i;
> static assert(i);
>
> >dmd -c source.d
> source.d(2): static assert (i) is not evaluatable at compile time
> i
>
> Note the superfluous i in the second line.
>
> Cause:
> diff -urBb /opt/dmd/0.151/src/dmd/staticassert.c
> /opt/dmd/0.153/src/dmd/staticassert.c
> --- /opt/dmd/0.151/src/dmd/staticassert.c
> +++ /opt/dmd/0.153/src/dmd/staticassert.c
> @@ -51,7 +51,10 @@
> if (e->isBool(FALSE))
> error("(%s) is false", exp->toChars());
> else if (!e->isBool(TRUE))
> + {
> error("(%s) is not evaluatable at compile time", exp->toChars());
> +printf("%s\n", e->toChars());
> + }
> }
>
> int StaticAssert::oneMember(Dsymbol **ps)
>