================
@@ -7815,8 +7812,15 @@ ExprResult Sema::ActOnFinishFullExpr(Expr *FE, 
SourceLocation CC,
   while (isa_and_nonnull<CapturedDecl>(DC))
     DC = DC->getParent();
   const bool IsInLambdaDeclContext = isLambdaCallOperator(DC);
+
+  // Do not check for potential captures if the function in which the lambda
+  // is defined does not have a valid decl. (GH187183)
+  FunctionDecl *FD = getCurFunctionDecl();
+  bool IsValidParentFunc = !FD || !FD->isInvalidDecl();
----------------
zyn0217 wrote:

I think we should bail out very early for invalid function declarations before 
getting here

https://github.com/llvm/llvm-project/pull/187676
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to