From 36ef7029ea437c216f0bde2a0d4817d8b15e47b2 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Tue, 29 Nov 2011 22:37:13 +0000 Subject: [PATCH] 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 --- lib/Sema/SemaExpr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); -- 2.50.1