Bug 9193 – Wrong code with mixing -inline/non-inline modules, nested functions and templates

Status
RESOLVED
Resolution
WORKSFORME
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-12-22T00:03:00Z
Last change time
2014-02-12T19:11:40Z
Keywords
wrong-code
Assigned to
nobody
Creator
dlang-bugzilla

Comments

Comment #0 by dlang-bugzilla — 2012-12-22T00:03:08Z
=== a.d === import b; void main() { f(); } === b.d === auto T(alias pred)() { return pred; } auto f() { string var="cheese"; void test() { assert(var=="cheese"); } T!test(); } === compilation instructions === dmd -c b.d dmd -inline a.d b.obj === result === The assert fails. If -inline is removed from the compilation command, the assert passes. This bug causes dirEntries with a wildcard to fail when programs are compiled with -inline. Marking as critical since wrong-code bugs appearing only in release builds are hard to track (Heisenbugs). Tested on Windows/32 and Linux/64.
Comment #1 by dlang-bugzilla — 2012-12-22T00:04:15Z
*** Issue 8250 has been marked as a duplicate of this issue. ***
Comment #2 by k.hara.pg — 2013-01-31T01:23:56Z
Probably, this is a dup of issue 9399.
Comment #3 by clugdbug — 2013-02-01T01:55:15Z
(In reply to comment #2) > Probably, this is a dup of issue 9399. I thought it was, but unfortunately this one is different.
Comment #4 by verylonglogin.reg — 2013-06-10T05:52:50Z
Does this trigger only "forward" i.e. when "-inline" compilation takes non-inline objects?
Comment #5 by maxim — 2013-12-16T13:00:16Z
I cannot reproduce with git head in linux/64.
Comment #6 by dlang-bugzilla — 2014-02-12T19:11:40Z
This was indeed fixed, by this pull: https://github.com/D-Programming-Language/dmd/pull/2550