checking for a lambda.
Thanks to Jordan for the pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181031
91177308-0d34-0410-b5e6-
96231b3b80d8
template <class T> static Decl *getNonClosureContext(T *D) {
if (getKind(D) == Decl::CXXMethod) {
CXXMethodDecl *MD = cast<CXXMethodDecl>(D);
- if (MD->getParent()->isLambda() &&
- MD->getOverloadedOperator() == OO_Call)
+ if (MD->getOverloadedOperator() == OO_Call &&
+ MD->getParent()->isLambda())
return getNonClosureContext(MD->getParent()->getParent());
return MD;
} else if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {