diff --git a/src/func.c b/src/func.c index d5a87f28ca82..36f35405287f 100644 --- a/src/func.c +++ b/src/func.c @@ -5152,10 +5152,14 @@ void UnitTestDeclaration::semantic(Scope *sc) protection = sc->protection; if (scope) - { sc = scope; + { + sc = scope; scope = NULL; } + if (!isInstantiated() && inNonRoot()) + return; + if (global.params.useUnitTests) { if (!type)