[clang] Fix MSVC "not all control paths return a value" warning. NFC. (PR #187265)

Simon Pilgrim via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 18 06:02:37 PDT 2026


https://github.com/RKSimon created https://github.com/llvm/llvm-project/pull/187265

None

>From b6fd07d99a042538695300276087252fa58e272f Mon Sep 17 00:00:00 2001
From: Simon Pilgrim <llvm-dev at redking.me.uk>
Date: Wed, 18 Mar 2026 13:00:00 +0000
Subject: [PATCH] Fix MSVC "not all control paths return a value" warning. NFC.

---
 clang/lib/Frontend/VerifyDiagnosticConsumer.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp b/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
index a03607bb60583..d58492b09b537 100644
--- a/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
+++ b/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
@@ -1231,6 +1231,7 @@ static unsigned CheckResultsAreInOrder(DiagnosticsEngine &Diags,
       case DiagnosticsEngine::Level::Ignored:
         llvm_unreachable("Unexpected diagnostic level!");
       }
+      llvm_unreachable("Unknown DiagnosticsEngine::Level enum");
     }();
 
     std::advance(It, DiagIndex);



More information about the cfe-commits mailing list