diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-09-23 19:04:03 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-09-23 19:04:03 +0000 |
commit | a120d01c66010db47332b7ca67b737fda6c2c264 (patch) | |
tree | f26205c7740ef072554d3267b754c99af2ac8c1a /lib | |
parent | e3f834950801f1334f1b3f3f7e9a34062905fe1d (diff) |
When checking for weak vtables, check whether the actual definition of
the key function is inline, rather than the original
declaration. Perhaps FunctionDecl::isInlined() is poorly named. Fixes
<rdar://problem/9979458>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140400 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index ef8719c48e..0727bbd36c 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -10302,7 +10302,10 @@ bool Sema::DefineUsedVTables() { // Optionally warn if we're emitting a weak vtable. if (Class->getLinkage() == ExternalLinkage && Class->getTemplateSpecializationKind() != TSK_ImplicitInstantiation) { - if (!KeyFunction || (KeyFunction->hasBody() && KeyFunction->isInlined())) + const FunctionDecl *KeyFunctionDef = 0; + if (!KeyFunction || + (KeyFunction->hasBody(KeyFunctionDef) && + KeyFunctionDef->isInlined())) Diag(Class->getLocation(), diag::warn_weak_vtable) << Class; } } |