rsmith added a comment. Ah, I think I see how we get here. I think this fix might possibly break a case such as:
template<typename T> int x = [](auto){ return T(); }.operator()(T()); int y = x<int>; ... where transforming the call to `operator()` might end up looking for the transformed version of the lambda class; we need to find that in the local instantiation scope. I think we want something like `isa<CXXRecordDecl>(D) && cast<CXXRecordDecl>(D)->isDependentLambda() && cast<CXXRecordDecl>(D)->getTemplateDepth() > TemplateArgs.getNumRetainedOuterLevels()`. (But I wonder if we can clean this up by switching to always checking the template depth of `D` rather than sometimes checking the parent's template depth.) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99134/new/ https://reviews.llvm.org/D99134 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits