Bug 6827 – `assert(0)` is ignored in a function template

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-10-18T11:09:00Z
Last change time
2012-01-09T02:07:06Z
Assigned to
nobody
Creator
verylonglogin.reg

Comments

Comment #0 by verylonglogin.reg — 2011-10-18T11:09:40Z
An assertion is ignored in the following example iff `t` is a function template and the first argument of the `assert` evaluates to zero at CT: --- import std.stdio; void t()() { assert(0, "Where am I?"); } void main() { t(); writeln("Where is he?"); } ---
Comment #1 by verylonglogin.reg — 2012-01-07T22:07:37Z
Fixed in head. It would be good to add unittests before closing this bug.
Comment #2 by k.hara.pg — 2012-01-09T02:07:06Z
*** This issue has been marked as a duplicate of issue 6205 ***