<div dir="ltr">Hi cfe-dev,<div><br></div><div>In clangd, we often hit the following assertion in the Sema's destructor:<br></div><div>    assert(DelayedTypos.empty() && "Uncorrected typos!");<br></div><div><br></div><div>It's purpose seems to be to indicate that there are places that should call CorrectDelayedTypos* and forget to do so.</div><div><br></div><div>However, when the assertion fires it's hard to track down the exact place where the CorrectDelayedTypos* call should be inserted. Moreover, it never fires in normal clang executions because the driver passes -disable-free by default, which stops Sema's destructor from running.</div><div><br></div><div>That leaves clangd and libclang in an unfortunate situation of being the only clients that experience crashes (apart from lit that run clang -cc1 mode and don't pass -disable-free).</div><div><br></div><div>We would like to avoid assertion failures for those, which leads me to the following questions:</div><div>- Is there a way to quickly track down the place that miss the CorrectDelayedTypos* call?</div><div>- If no, would it be ok to turn this assertion into some kind of debug-only warning and </div><div>  document that some typos are never actually corrected due to limitations?</div><div>- Even broader, are there any ideas for an alternative design that would be more resilient to</div><div>  changes in the codebase? </div><div>  E.g. no delayed typo corrections or easy-to-audit places that should run CorrectDelayedTypos*, etc.</div><div><br></div><div>-- <br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Regards,</div><div>Ilya Biryukov</div></div></div></div></div></div></div>