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

purnima shrivastava via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 5 01:26:13 PDT 2026


================
@@ -3138,6 +3138,11 @@ FunctionDecl::DefaultedOrDeletedFunctionInfo::Create(
 void FunctionDecl::setDefaultedOrDeletedInfo(
     DefaultedOrDeletedFunctionInfo *Info) {
   assert(!FunctionDeclBits.HasDefaultedOrDeletedInfo && "already have this");
+
+  // Guard against assertions tripping during error-recovery states
+  if (isInvalidDecl() || Body)
----------------
purnima-nlp wrote:

Yes right, earlier I thought we need to just remove the bug, yes this time I will understand the indepth root of this bug, I'm trying to figure out where exactly it started , I'm reading sema codebase and include files.


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


More information about the cfe-commits mailing list