Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,12 @@ void FuncDeclaration::toObjFile(int multiobj)
TemplateInstance *ti = inTemplateInstance();
if (!global.params.useUnitTests &&
!global.params.allInst &&
/* The issue is that if the importee is compiled with a different -debug
* setting than the importer, the importer may believe it exists
* in the compiled importee when it does not, when the instantiation
* is behind a conditional debug declaration.
*/
!global.params.debuglevel && // workaround for Bugzilla 11239
ti && ti->instantiatingModule && !ti->instantiatingModule->isRoot())
{
Module *mi = ti->instantiatingModule;
Expand Down
11 changes: 11 additions & 0 deletions test/runnable/imports/inc11239.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// REQUIRED_ARGS:

int foo(T)(T x)
{
return 3;
}

debug
{
int x = foo(2);
}
11 changes: 11 additions & 0 deletions test/runnable/test11239.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// EXTRA_SOURCES: imports/inc11239.d
// REQUIRED_ARGS: -debug
// COMPILE_SEPARATELY
// PERMUTE_ARGS:

import imports.inc11239;

void main()
{
foo(1);
}