================
@@ -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)
----------------
ojhunt wrote:

This change seems to be simply de-fanging the assertion - the assertion is not 
removed, it simply becomes a no-op because you have inserted an `if (... || 
Body)` gate.

This is a symptom gate - an assertion is an indication that something is wrong. 
The assertion itself is not the bug.

If you believe that the assertion is wrong, you need to include an explanation 
of why it is wrong. Hitting an assertion is not evidence the assertion is wrong.





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

Reply via email to