[clang] Revert "[clang] Silence GCC warnings about control reaching end of non void function" (PR #108646)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 13 14:03:03 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Florian Mayer (fmayer)
<details>
<summary>Changes</summary>
This reverts commit 90a2e0bb423629b7e70f4b91adb44851199dd5ea.
Reverting parent CL
---
Full diff: https://github.com/llvm/llvm-project/pull/108646.diff
2 Files Affected:
- (modified) clang/include/clang/Basic/DiagnosticIDs.h (-2)
- (modified) clang/lib/Sema/SemaOverload.cpp (-1)
``````````diff
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()))
``````````
</details>
https://github.com/llvm/llvm-project/pull/108646
More information about the cfe-commits
mailing list