PR #61326
- fix clang crash when fold expression contains a delayed typos correction.
code snippet in ActOnCXXFoldExpr
if (!LHS || !RHS) { Expr *Pack = LHS ? LHS : RHS; assert(Pack && "fold expression with neither LHS nor RHS"); DiscardOperands(); if (!Pack->containsUnexpandedParameterPack()) return Diag(EllipsisLoc, diag::err_pack_expansion_without_parameter_packs) << Pack->getSourceRange(); }
DiscardOperands will be triggered when LHS/RHS is delayed typo correction expression.
It will output and clean all diagnose but still return a valid expression. (in else branch)
valid expression will be handled in caller function. When caller wants to output the diagnose, the diagnose in delayed typo correction expression has been consumed in ActOnCXXFoldExpr. It causes clang crash.
This should go in the Bug Fixes In This Version section, right below this. Also, try to elaborate and make it more like the format of the others around there.