From cd95922bd1cd01c021fc4d517fa4b23edb488ae3 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Mon, 9 Jun 2014 18:30:28 +0000 Subject: Allow definition of dllimport static fields in partial specializations (PR19956) This expands the logic from r210141 to cover partial specializations too. llvm-svn: 210484 --- clang/lib/Sema/SemaDecl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'clang/lib/Sema/SemaDecl.cpp') 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(VD->getFirstDecl()->getDeclContext()); bool IsClassTemplateMember = - cast(VD->getFirstDecl()->getDeclContext()) - ->getDescribedClassTemplate(); + isa(Context) || + Context->getDescribedClassTemplate(); Diag(VD->getLocation(), IsClassTemplateMember -- cgit v1.2.3