summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2018-10-31 10:34:46 +0000
committerHans Wennborg <hans@hanshq.net>2018-10-31 10:34:46 +0000
commit262baa4753e22ef25906a2fcea6e7e0d7140d9f2 (patch)
treed0c188118fafae4109755c1b601c698a82193524 /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
parent541f824d32e8caee27f8fbd993a7dc8b63040b65 (diff)
downloadbcm5719-llvm-262baa4753e22ef25906a2fcea6e7e0d7140d9f2.tar.gz
bcm5719-llvm-262baa4753e22ef25906a2fcea6e7e0d7140d9f2.zip
Follow-up to r345699: Call CheckStaticLocalForDllExport later for templates
Calling it too early might cause dllimport to get inherited onto the VarDecl before the initializer got attached. See the test case for an example where this broke things. llvm-svn: 345709
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiateDecl.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 1256a6bf5c2..4f7ecdfcdfd 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -728,9 +728,6 @@ Decl *TemplateDeclInstantiator::VisitVarDecl(VarDecl *D,
D->getLocation(), D->getIdentifier(), DI->getType(),
DI, D->getStorageClass());
- if (Var->isStaticLocal())
- SemaRef.CheckStaticLocalForDllExport(Var);
-
// In ARC, infer 'retaining' for variables of retainable type.
if (SemaRef.getLangOpts().ObjCAutoRefCount &&
SemaRef.inferObjCARCLifetime(Var))
@@ -751,6 +748,9 @@ Decl *TemplateDeclInstantiator::VisitVarDecl(VarDecl *D,
Var->setImplicit(D->isImplicit());
+ if (Var->isStaticLocal())
+ SemaRef.CheckStaticLocalForDllExport(Var);
+
return Var;
}
OpenPOWER on IntegriCloud