Skip to content

Commit

Permalink
fix Issue 14588 - undefined reference error while linking with -debug…
Browse files Browse the repository at this point in the history
… option to a static library
  • Loading branch information
9rnsr committed Jul 6, 2015
1 parent e03bfc2 commit fcb7915
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/template.c
Expand Up @@ -7861,10 +7861,10 @@ bool TemplateInstance::needsCodegen()
global.params.allInst ||
global.params.debuglevel)
{
//printf("%s minst = %s, enclosing in nonRoot = %d\n",
//printf("%s minst = %s, enclosing (%s)->isNonRoot = %d\n",
// toPrettyChars(), minst ? minst->toChars() : NULL,
// enclosing && enclosing->inNonRoot());
if (enclosing)
// enclosing ? enclosing->toPrettyChars() : NULL, enclosing && enclosing->inNonRoot());
if (enclosing && !tinst)
{
// Bugzilla 13415: If and only if the enclosing scope needs codegen,
// the nested templates would need code generation.
Expand Down
15 changes: 15 additions & 0 deletions test/runnable/imports/link14588a.d
@@ -0,0 +1,15 @@
module imports.link14588a;

void func(alias a)()
{
}

class A
{
int i;

void all()()
{
func!(i)();
}
}
10 changes: 10 additions & 0 deletions test/runnable/link14588.d
@@ -0,0 +1,10 @@
// EXTRA_SOURCES: imports/link14588a.d
// PERMUTE_ARGS: -allinst -unittest -debug -inline
// COMPILE_SEPARATELY

import imports.link14588a;

void main()
{
new A().all();
}

0 comments on commit fcb7915

Please sign in to comment.