Bug 14508 – [REG2.067.0] compiling with -unittest instantiates templates in non-root modules

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-04-27T02:03:00Z
Last change time
2015-08-31T11:09:28Z
Keywords
pull
Assigned to
nobody
Creator
code
See also
https://issues.dlang.org/show_bug.cgi?id=14431

Comments

Comment #0 by code — 2015-04-27T02:03:14Z
cat > foo.d << CODE import bar; CODE cat > bar.d << CODE struct MonoTimeImpl() { } alias MonoTime = MonoTimeImpl!(); CODE dmd -c -unittest foo nm foo.o ---- As bar.d isn't a root module the MonoTimeImpl!() template shouldn't be instantiated. It works correctly with -O -release -inline and only fails with -unittest.
Comment #1 by dlang-bugzilla — 2015-04-27T07:15:03Z
Comment #2 by k.hara.pg — 2015-05-03T04:43:25Z
Comment #3 by bugzilla — 2015-06-27T23:49:50Z
Comment #4 by k.hara.pg — 2015-06-29T10:11:59Z
Comment #5 by k.hara.pg — 2015-08-31T11:09:28Z
In 2.068.1-b2, it's properly fixed, by the PR: https://github.com/D-Programming-Language/dmd/pull/4944