[clang] [Clang] Fix inverted diagnostic location for duplicate default labels (PR #180447)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 13 06:30:28 PST 2026


================
@@ -1369,8 +1373,9 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, Stmt *Switch,
 
     if (DefaultStmt *DS = dyn_cast<DefaultStmt>(SC)) {
       if (TheDefaultStmt) {
-        Diag(DS->getDefaultLoc(), diag::err_multiple_default_labels_defined);
-        Diag(TheDefaultStmt->getDefaultLoc(), diag::note_duplicate_case_prev);
+        Diag(TheDefaultStmt->getDefaultLoc(),
----------------
erichkeane wrote:

The change here implies you're getting this wrong.


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


More information about the cfe-commits mailing list