summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2014-10-29 21:20:57 +0000
committerHans Wennborg <hans@hanshq.net>2014-10-29 21:20:57 +0000
commitac6073bb1f01e67c47e004c5f3adb2bd6c1230cb (patch)
treef400977223331e4e09ab234fe852e0ead32faff4 /clang/lib
parent323d57336c74715ebf79b597dd0a239849e8456e (diff)
downloadbcm5719-llvm-ac6073bb1f01e67c47e004c5f3adb2bd6c1230cb.tar.gz
bcm5719-llvm-ac6073bb1f01e67c47e004c5f3adb2bd6c1230cb.zip
Follow-up to r216619: use isCXXCLassMember() instead of trying to
check the context ourselves when selectively allowing late-added dll attributes on unused free functions and variables (PR20746) llvm-svn: 220874
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 16a84ffd30f..deac7c7d33b 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -5140,7 +5140,7 @@ static void checkDLLAttributeRedeclaration(Sema &S, NamedDecl *OldDecl,
// If the declaration hasn't been used yet, allow with a warning for
// free functions and global variables.
bool JustWarn = false;
- if (!OldDecl->isUsed() && OldDecl->getDeclContext()->isFileContext()) {
+ if (!OldDecl->isUsed() && !OldDecl->isCXXClassMember()) {
auto *VD = dyn_cast<VarDecl>(OldDecl);
if (VD && !VD->getDescribedVarTemplate())
JustWarn = true;
OpenPOWER on IntegriCloud