]> granicus.if.org Git - clang/commitdiff
Fixed lexical decl context of out of line class template instantiations.
authorAbramo Bagnara <abramo.bagnara@gmail.com>
Wed, 5 Sep 2012 09:05:18 +0000 (09:05 +0000)
committerAbramo Bagnara <abramo.bagnara@gmail.com>
Wed, 5 Sep 2012 09:05:18 +0000 (09:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163206 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaTemplate.cpp

index 977b3602307e0a088ec4f00c7be04c9e03b4e5b7..d6ad8ebf53506c10b4a50799be7f0dab5bd208fe 100644 (file)
@@ -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);