From: Richard Smith Date: Mon, 23 Sep 2013 23:12:22 +0000 (+0000) Subject: Revert change accidentally committed in r191150. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=90618ff0b53f063a880c4933d44c70d6c1cb8dc0;p=clang Revert change accidentally committed in r191150. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191237 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index d712cec220..e03e8c55c9 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -3372,9 +3372,7 @@ void Sema::BuildVariableInstantiation( OldVar->isPreviousDeclInSameBlockScope()); NewVar->setAccess(OldVar->getAccess()); - // For local variables, inherit the 'used' and 'referenced' flags from the - // primary template. - if (OldVar->getLexicalDeclContext()->isFunctionOrMethod()) { + if (!OldVar->isStaticDataMember()) { NewVar->setIsUsed(OldVar->isUsed(false)); NewVar->setReferenced(OldVar->isReferenced()); }