summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2014-06-09 18:30:28 +0000
committerHans Wennborg <hans@hanshq.net>2014-06-09 18:30:28 +0000
commitcd95922bd1cd01c021fc4d517fa4b23edb488ae3 (patch)
treecf7fd08d6c287df213c31964fa6d31bf224a1165 /clang/lib/Sema/SemaDecl.cpp
parentc817d6a5b537c225b9af2e86cd0432996bb74c99 (diff)
downloadbcm5719-llvm-cd95922bd1cd01c021fc4d517fa4b23edb488ae3.tar.gz
bcm5719-llvm-cd95922bd1cd01c021fc4d517fa4b23edb488ae3.zip
Allow definition of dllimport static fields in partial specializations (PR19956)
This expands the logic from r210141 to cover partial specializations too. llvm-svn: 210484
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index ec0c27b2d2e..09fcf1c8cbe 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -9111,9 +9111,11 @@ Sema::FinalizeDeclaration(Decl *ThisDecl) {
VD->isThisDeclarationADefinition()) {
// We allow definitions of dllimport class template static data members
// with a warning.
+ CXXRecordDecl *Context =
+ cast<CXXRecordDecl>(VD->getFirstDecl()->getDeclContext());
bool IsClassTemplateMember =
- cast<CXXRecordDecl>(VD->getFirstDecl()->getDeclContext())
- ->getDescribedClassTemplate();
+ isa<ClassTemplatePartialSpecializationDecl>(Context) ||
+ Context->getDescribedClassTemplate();
Diag(VD->getLocation(),
IsClassTemplateMember
OpenPOWER on IntegriCloud