]> granicus.if.org Git - clang/commitdiff
Don't insert in lexical context implicit definitions of static member instances.
authorAbramo Bagnara <abramo.bagnara@gmail.com>
Fri, 4 Jun 2010 09:35:39 +0000 (09:35 +0000)
committerAbramo Bagnara <abramo.bagnara@gmail.com>
Fri, 4 Jun 2010 09:35:39 +0000 (09:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105465 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaTemplateInstantiateDecl.cpp

index 7981c3c949a4ceda17ae0ddf4d47a4a55b3d1545..939f6caa96a5a79a16d20f8282d6baeddd925d5d 100644 (file)
@@ -373,7 +373,8 @@ Decl *TemplateDeclInstantiator::VisitVarDecl(VarDecl *D) {
   SemaRef.CheckVariableDeclaration(Var, Previous, Redeclaration);
 
   if (D->isOutOfLine()) {
-    D->getLexicalDeclContext()->addDecl(Var);
+    if (!D->isStaticDataMember())
+      D->getLexicalDeclContext()->addDecl(Var);
     Owner->makeDeclVisibleInContext(Var);
   } else {
     Owner->addDecl(Var);