summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 659969334ed..521b420e567 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -5006,10 +5006,11 @@ RecordDynamicClassesWithNoKeyFunction(Sema &S, CXXRecordDecl *Record,
const CXXMethodDecl *KeyFunction = S.Context.getKeyFunction(Record);
if (!KeyFunction)
- S.ClassesWithUnmarkedVirtualMembers.push_back(std::make_pair(Record, Loc));
-
- if ((!KeyFunction || KeyFunction->getBody() && KeyFunction->isInlined()) &&
- Record->getLinkage() == ExternalLinkage)
+ S.ClassesWithUnmarkedVirtualMembers.push_back(std::make_pair(Record,
+ Loc));
+
+ if ((!KeyFunction || (KeyFunction->getBody() && KeyFunction->isInlined()))
+ && Record->getLinkage() == ExternalLinkage)
S.Diag(Record->getLocation(), diag::warn_weak_vtable) << Record;
}
for (DeclContext::decl_iterator D = Record->decls_begin(),
OpenPOWER on IntegriCloud