summaryrefslogtreecommitdiffstats
path: root/clang/lib
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
commitc8c3b403c50bc133f83e83b15b1d943f77a71967 (patch)
treeb8e19126370ec61c453484b4854469ddf150ad4c /clang/lib
parentbde32d36bb4ebdeda66b432c04796905c65bc6f0 (diff)
downloadbcm5719-llvm-c8c3b403c50bc133f83e83b15b1d943f77a71967.tar.gz
bcm5719-llvm-c8c3b403c50bc133f83e83b15b1d943f77a71967.zip
Test isa<FunctionDecl> to exclude objective-C methods. This ensures the following cast will never fail.
llvm-svn: 145441
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index d5e6ea74223..12a13f1aa45 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/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();
OpenPOWER on IntegriCloud