www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14508] New: compiling with -unittest instantiates templates


          Issue ID: 14508
           Summary: compiling with -unittest instantiates templates in
                    non-root modules
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: code dawg.eu

cat > foo.d << CODE
import bar;

cat > bar.d << CODE
struct MonoTimeImpl()

alias MonoTime = MonoTimeImpl!();

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

Apr 26 2015