[clang] [Clang][Sema] fix crash in codegen stage when an lambda expression declared in an unevaluated context (PR #80802)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 12 07:32:03 PST 2024


================
@@ -1614,7 +1614,19 @@ bool TemplateInstantiator::AlreadyTransformed(QualType T) {
   if (T.isNull())
     return true;
 
-  if (T->isInstantiationDependentType() || T->isVariablyModifiedType())
+  bool DependentLambdaType = false;
+  QualType DesugaredType = T.getDesugaredType(SemaRef.getASTContext());
+  CXXRecordDecl *RD = DesugaredType->getAsCXXRecordDecl();
+  if (RD && RD->isLambda()) {
----------------
erichkeane wrote:

`if (auto *RD = T->getAsCXXRecordDecl(); RD && RD->isLambda())`

??

https://github.com/llvm/llvm-project/pull/80802


More information about the cfe-commits mailing list