From: Lang Hames Date: Tue, 29 Nov 2011 22:37:13 +0000 (+0000) Subject: Test isa to exclude objective-C methods. This ensures the following... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=36ef7029ea437c216f0bde2a0d4817d8b15e47b2;p=clang Test isa 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 --- 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(DC) && cast(DC)->getFriendObjectKind() && DC->getLexicalParent()->isRecord()) DC = DC->getLexicalParent();