D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6827 - `assert(0)` is ignored in a function template
Summary: `assert(0)` is ignored in a function template
Status: RESOLVED DUPLICATE of issue 6205
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-18 11:09 UTC by Denis Shelomovskii
Modified: 2012-01-09 02:07 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Denis Shelomovskii 2011-10-18 11:09:40 UTC
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 Denis Shelomovskii 2012-01-07 22:07:37 UTC
Fixed in head.
It would be good to add unittests before closing this bug.
Comment 2 Kenji Hara 2012-01-09 02:07:06 UTC

*** This issue has been marked as a duplicate of issue 6205 ***