diff options
author | Hans Wennborg <hans@hanshq.net> | 2014-10-29 21:20:57 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2014-10-29 21:20:57 +0000 |
commit | 3e9c1922fa42ec63cac13cf22707dea71590791f (patch) | |
tree | b025469f486900fba61dbc846c45c5903f6934db /lib/Sema/SemaDecl.cpp | |
parent | 08a1416b41b655a604dbbe0b7f3ad152e69c647f (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.cpp | 2 |
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; |