Skip to content

Commit

Permalink
Issue 4328 - templated unittests fail to link when instantiated from …
Browse files Browse the repository at this point in the history
…other file if compiler order isn't correct
  • Loading branch information
WalterBright committed Feb 7, 2011
1 parent ec462ee commit 76038f0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/template.c
@@ -1,6 +1,6 @@

// Compiler implementation of the D programming language
// Copyright (c) 1999-2010 by Digital Mars
// Copyright (c) 1999-2011 by Digital Mars
// All Rights Reserved
// written by Walter Bright
// http://www.digitalmars.com
Expand Down Expand Up @@ -440,6 +440,15 @@ void TemplateDeclaration::semantic(Scope *sc)
sc->module->toModuleAssert();
}

#if DMDV2
if (/*global.params.useUnitTests &&*/ sc->module)
{
// Generate this function as it may be used
// when template is instantiated in other modules
sc->module->toModuleUnittest();
}
#endif

/* Remember Scope for later instantiations, but make
* a copy since attributes can change.
*/
Expand Down

0 comments on commit 76038f0

Please sign in to comment.