[Issue 9193] New: Wrong code with mixing -inline/non-inline modules, nested functions and templates

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Dec 22 00:03:21 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=9193

           Summary: Wrong code with mixing -inline/non-inline modules,
                    nested functions and templates
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: wrong-code
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: thecybershadow at gmail.com


--- Comment #0 from Vladimir Panteleev <thecybershadow at gmail.com> 2012-12-22 00:03:08 PST ---
=== 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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list