summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaDecl.cpp
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
commit3e9c1922fa42ec63cac13cf22707dea71590791f (patch)
treeb025469f486900fba61dbc846c45c5903f6934db /lib/Sema/SemaDecl.cpp
parent08a1416b41b655a604dbbe0b7f3ad152e69c647f (diff)
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) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220874 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 16a84ffd30..deac7c7d33 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/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;