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 | 34bc6e5ee401508a24cddd827c53b514dceb2347 (patch) | |
tree | 2b45f71a6b02f4951ffb8dfd640aa9707b65e8eb /clang/lib/Sema/SemaDeclCXX.cpp | |
parent | c367b8f8cc2352430f434254ee4d6b23d6af59a9 (diff) | |
download | bcm5719-llvm-34bc6e5ee401508a24cddd827c53b514dceb2347.tar.gz bcm5719-llvm-34bc6e5ee401508a24cddd827c53b514dceb2347.zip |
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>.
llvm-svn: 140400
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index ef8719c48e5..0727bbd36c6 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/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; } } |