[clang] Fix crash on defaulted comparison recovery in Sema and AST (PR #210668)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 22 09:04:27 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)
----------------
Sirraide wrote:
Yeah, I don’t believe this function is the right place to do this; we shouldn’t be calling `setDefaultedOrDeletedInfo()` to begin with if there’s already a body I think
https://github.com/llvm/llvm-project/pull/210668
More information about the cfe-commits
mailing list