// 'this' refers to a this to the enclosing scope, there is no right region to
// return.
while (!LC->inTopFrame() &&
- (!D || PT != D->getThisType(getContext())->getAs<PointerType>())) {
+ (!D || D->isStatic() ||
+ PT != D->getThisType(getContext())->getAs<PointerType>())) {
LC = LC->getParent();
D = dyn_cast<CXXMethodDecl>(LC->getDecl());
}
int x;
void f() {
callLambda([&](){ ++x; });
+ callLambdaFromStatic([&](){ ++x; });
+ }
+
+ template<typename T>
+ static void callLambdaFromStatic(T t) {
+ t();
}
};