diff --git a/src/dmd/dsymbolsem.d b/src/dmd/dsymbolsem.d index 935369d3e2..b8d50768b0 100644 --- a/src/dmd/dsymbolsem.d +++ b/src/dmd/dsymbolsem.d @@ -5963,6 +5963,8 @@ void templateInstanceSemantic(TemplateInstance tempinst, Scope* sc, Expressions* } tempinst.hasNestedArgs(tempinst.tiargs, tempdecl.isstatic); + if (tempinst.errors) + goto Lerror; // Copy the tempdecl namespace (not the scope one) tempinst.cppnamespace = tempdecl.cppnamespace; diff --git a/test/fail_compilation/fail21648.d b/test/fail_compilation/fail21648.d deleted file mode 100644 index b94313094a..0000000000 --- a/test/fail_compilation/fail21648.d +++ /dev/null @@ -1,16 +0,0 @@ -// REQUIRED_ARGS: -de -/* -TEST_OUTPUT: ---- -fail_compilation/fail21648.d(10): Error: undefined identifier `semantics` ---- -*/ - -template bla() { - semantics error; -} - -struct Type { - enum e = __traits(compiles, Type.init); - static if (bla!()) { } -}