]> granicus.if.org Git - clang/commitdiff
Test isa<FunctionDecl> to exclude objective-C methods. This ensures the following...
authorLang Hames <lhames@gmail.com>
Tue, 29 Nov 2011 22:37:13 +0000 (22:37 +0000)
committerLang Hames <lhames@gmail.com>
Tue, 29 Nov 2011 22:37:13 +0000 (22:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145441 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp

index d5e6ea74223fcb5a99873b4e7a7c7a69be8ecf78..12a13f1aa45b52bc5a610414d4c14d1b15b54577 100644 (file)
@@ -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();