[clang] Revert "[clang] Silence GCC warnings about control reaching end of non void function" (PR #108646)

Florian Mayer via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 13 14:02:28 PDT 2024


https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/108646

This reverts commit 90a2e0bb423629b7e70f4b91adb44851199dd5ea.

Reverting parent CL


>From 6bc1ea84e078d01546286e6443d761e2a685902d Mon Sep 17 00:00:00 2001
From: Florian Mayer <fmayer at google.com>
Date: Fri, 13 Sep 2024 14:02:14 -0700
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=
 =?UTF-8?q?l=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.4
---
 clang/include/clang/Basic/DiagnosticIDs.h | 2 --
 clang/lib/Sema/SemaOverload.cpp           | 1 -
 2 files changed, 3 deletions(-)

diff --git a/clang/include/clang/Basic/DiagnosticIDs.h b/clang/include/clang/Basic/DiagnosticIDs.h
index daad66f499538f..2402996ece5c94 100644
--- a/clang/include/clang/Basic/DiagnosticIDs.h
+++ b/clang/include/clang/Basic/DiagnosticIDs.h
@@ -18,7 +18,6 @@
 #include "clang/Basic/LLVM.h"
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
 #include "llvm/ADT/StringRef.h"
-#include "llvm/Support/ErrorHandling.h"
 #include <optional>
 #include <vector>
 
@@ -311,7 +310,6 @@ class DiagnosticIDs : public RefCountedBase<DiagnosticIDs> {
         return {diag::Severity::Fatal, std::string(Message), CLASS_ERROR,
                 /*ShowInSystemHeader*/ true};
       }
-      llvm_unreachable("Fully covered switch above!");
     }());
   }
 
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 382630ed674107..d3e009a658f0e8 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -7331,7 +7331,6 @@ static bool diagnoseDiagnoseIfAttrsWith(Sema &S, const NamedDecl *ND,
     case DiagnoseIfAttr::DS_error:
       return diag::Severity::Error;
     }
-    llvm_unreachable("Fully covered switch above!");
   };
 
   for (const auto *DIA : llvm::make_range(WarningBegin, Attrs.end()))



More information about the cfe-commits mailing list