================
@@ -2287,6 +2288,15 @@ APValue SourceLocExpr::EvaluateInContext(const 
ASTContext &Ctx,
     Context = getParentContext();
   }
 
+  // If we are currently parsing a lambda declarator, we might not have a fully
+  // formed call operator declaration yet, and we could not form a function 
name
+  // for it. Because we do not have access to Sema/function scopes here, we
+  // detect this case by relying on the fact such method doesn't yet have a
+  // type.
+  if (const auto *D = dyn_cast<CXXMethodDecl>(Context);
+      D && D->getFunctionTypeLoc().isNull() && isLambdaCallOperator(D))
+    Context = D->getParent()->getParent();
----------------
erichkeane wrote:

So the first `getParent` should get the lambda object, correct?  

Could this cause issues where the parent of the lambda is a TU?  Can we have a 
test for that?  Also, there are some goofinesses around variable templates and 
requires in a lambda, can we have a test for that?

https://github.com/llvm/llvm-project/pull/107411
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to