From 7a58b2c1b2d2835b150433d6e940c584cfd0ea8e Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Mon, 18 Mar 2013 13:04:29 +0100 Subject: [PATCH] Backport DMD pull request #1760. Fixes DMD test case 'xtest46'. --- dmd2/template.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dmd2/template.c b/dmd2/template.c index 5aabcd0f..367db45d 100644 --- a/dmd2/template.c +++ b/dmd2/template.c @@ -5081,6 +5081,11 @@ void TemplateInstance::semantic(Scope *sc, Expressions *fargs) #endif // Copy the syntax trees from the TemplateDeclaration +#if IN_LLVM // Backport of DMD pull request #1760. + if (members && speculative) + {} // Don't copy again so they were previously created. + else +#endif members = Dsymbol::arraySyntaxCopy(tempdecl->members); // Create our own scope for the template parameters @@ -6644,6 +6649,11 @@ void TemplateMixin::semantic(Scope *sc) } // Copy the syntax trees from the TemplateDeclaration +#if IN_LLVM // Backport of DMD pull request #1760. + if (scx && members) + {} // Don't copy again so they were previously created. + else +#endif members = Dsymbol::arraySyntaxCopy(tempdecl->members); if (!members) return;