aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2011-11-29 22:37:13 +0000
committerLang Hames <lhames@gmail.com>2011-11-29 22:37:13 +0000
commit36ef7029ea437c216f0bde2a0d4817d8b15e47b2 (patch)
tree22352fb2f8a1401df054d212fccece1c8c90fdb3 /lib/Sema/SemaExpr.cpp
parent213d1be740f0150a338d5f58f1bce8c219775400 (diff)
Test isa<FunctionDecl> to exclude objective-C methods. This ensures the following cast will never fail.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145441 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index d5e6ea7422..12a13f1aa4 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -1592,7 +1592,7 @@ bool Sema::DiagnoseEmptyLookup(Scope *S, CXXScopeSpec &SS, LookupResult &R,
// function definition declared at class scope then we must set
// DC to the lexical parent to be able to search into the parent
// class.
- if (getLangOptions().MicrosoftMode && DC->isFunctionOrMethod() &&
+ if (getLangOptions().MicrosoftMode && isa<FunctionDecl>(DC) &&
cast<FunctionDecl>(DC)->getFriendObjectKind() &&
DC->getLexicalParent()->isRecord())
DC = DC->getLexicalParent();