summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2015-07-14 23:36:10 +0000
committerDavide Italiano <davide@freebsd.org>2015-07-14 23:36:10 +0000
commitccb37385275818aaeabc4f60cf9655d6075c2478 (patch)
tree7d55da25739f9eb65d4ebcc3a88aaa5b50e1c6c9 /clang/lib/Sema/SemaExpr.cpp
parent5808cd83e3a9f265e37f00f729ba15d7827f71d2 (diff)
downloadbcm5719-llvm-ccb37385275818aaeabc4f60cf9655d6075c2478.tar.gz
bcm5719-llvm-ccb37385275818aaeabc4f60cf9655d6075c2478.zip
[Sema] Don't emit "pure virtual" warning for fully qualified calls.
-fapple-kext is an exception because calls will still go through the vtable in that mode. Add a note to make the user aware of that. PR: 23215 Differential Revision: http://reviews.llvm.org/D10935 llvm-svn: 242246
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 1ae983cad22..f384f56269a 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -13241,7 +13241,8 @@ static void MarkExprReferenced(Sema &SemaRef, SourceLocation Loc,
if (!MD)
return;
// Only attempt to devirtualize if this is truly a virtual call.
- bool IsVirtualCall = MD->isVirtual() && !ME->hasQualifier();
+ bool IsVirtualCall = MD->isVirtual() &&
+ ME->performsVirtualDispatch(SemaRef.getLangOpts());
if (!IsVirtualCall)
return;
const Expr *Base = ME->getBase();
@@ -13275,7 +13276,7 @@ void Sema::MarkMemberReferenced(MemberExpr *E) {
// expression, is odr-used, unless it is a pure virtual function and its
// name is not explicitly qualified.
bool OdrUse = true;
- if (!E->hasQualifier()) {
+ if (E->performsVirtualDispatch(getLangOpts())) {
if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(E->getMemberDecl()))
if (Method->isPure())
OdrUse = false;
OpenPOWER on IntegriCloud