[clang] Fix crash on defaulted comparison recovery in Sema and AST (PR #210668)

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 5 01:12:10 PDT 2026


================
@@ -18806,7 +18806,7 @@ void Sema::SetDeclDefaulted(Decl *Dcl, SourceLocation DefaultLoc) {
   // Only allocate DefaultedOrDeletedFunctionInfo if we actually have
   // non-default FP features to stash. This avoids memory overhead for
   // the vast majority of defaulted functions.
-  if (!FD->getDefaultedOrDeletedInfo() &&
+  if (!FD->isInvalidDecl() && !FD->getDefaultedOrDeletedInfo() &&
----------------
ojhunt wrote:

ditto

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


More information about the cfe-commits mailing list