From: Abramo Bagnara Date: Wed, 5 Sep 2012 09:05:18 +0000 (+0000) Subject: Fixed lexical decl context of out of line class template instantiations. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f216d38201d8fcb0ffd76f8984f4da052b12f5f;p=clang Fixed lexical decl context of out of line class template instantiations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163206 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 977b360230..d6ad8ebf53 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -2088,7 +2088,8 @@ QualType Sema::CheckTemplateIdType(TemplateName Name, Converted.data(), Converted.size(), 0); ClassTemplate->AddSpecialization(Decl, InsertPos); - Decl->setLexicalDeclContext(CurContext); + if (ClassTemplate->isOutOfLine()) + Decl->setLexicalDeclContext(ClassTemplate->getLexicalDeclContext()); } CanonType = Context.getTypeDeclType(Decl);