[clang] [clang-tools-extra] Remove delayed typo expressions (PR #143423)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 11 04:57:31 PDT 2025


================
@@ -1888,10 +1888,11 @@ namespace PR15884 {
 }
 
 namespace AfterError {
-  constexpr int error() {
+  constexpr int error() { // pre-cxx23-error {{no return statement in constexpr function}}
----------------
AaronBallman wrote:

Hmm okay, I didn't write it in the issue but I was thinking that suppression of follow-on diagnostics is also about the context of the typo (if typo correction results in us dropping a statement, we should suppress follow-on diagnostics about the dropped statement). But you're right, this is orthogonal, it's more general about error recovery. We previously would not drop the `return` statement here but would instead give it a `RecoveryExpr` for its operand, that no longer happens.

I've filed [X](https://github.com/llvm/llvm-project/issues/143688) on the assumption we're removing delayed typos so this will eventually be true. :-D

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


More information about the cfe-commits mailing list