[clang] 539e076 - Fix MSVC "not all control paths return a value" warnings. NFC.
Simon Pilgrim via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 3 02:50:21 PDT 2023
Author: Simon Pilgrim
Date: 2023-11-03T09:50:09Z
New Revision: 539e076e1c99f4fba7f139f819f8e95b09ee8faf
URL: https://github.com/llvm/llvm-project/commit/539e076e1c99f4fba7f139f819f8e95b09ee8faf
DIFF: https://github.com/llvm/llvm-project/commit/539e076e1c99f4fba7f139f819f8e95b09ee8faf.diff
LOG: Fix MSVC "not all control paths return a value" warnings. NFC.
Added:
Modified:
clang/include/clang/Basic/Linkage.h
clang/lib/AST/Decl.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/Basic/Linkage.h b/clang/include/clang/Basic/Linkage.h
index 9cf36e522947fa8..fcf56b93b9781d7 100644
--- a/clang/include/clang/Basic/Linkage.h
+++ b/clang/include/clang/Basic/Linkage.h
@@ -100,6 +100,7 @@ inline bool isExternallyVisible(Linkage L) {
case Linkage::External:
return true;
}
+ llvm_unreachable("Unhandled Linkage enum");
}
inline Linkage getFormalLinkage(Linkage L) {
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index e8062b680fbc3ab..42ba8582c46de84 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -1934,6 +1934,7 @@ bool NamedDecl::hasLinkage() const {
case Linkage::External:
return true;
}
+ llvm_unreachable("Unhandled Linkage enum");
}
NamedDecl *NamedDecl::getUnderlyingDeclImpl() {
More information about the cfe-commits
mailing list