From: Simon Pilgrim Date: Fri, 21 Feb 2020 18:23:29 +0000 (+0000) Subject: Fix MSVC "not all control paths return a value" warning. NFCI. X-Git-Tag: llvmorg-12-init~13966 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1723f219939e1d4dc1c53ec7caf10c9380822b99;p=platform%2Fupstream%2Fllvm.git Fix MSVC "not all control paths return a value" warning. NFCI. --- diff --git a/clang/lib/ASTMatchers/GtestMatchers.cpp b/clang/lib/ASTMatchers/GtestMatchers.cpp index 317bddd..c99fdf6 100644 --- a/clang/lib/ASTMatchers/GtestMatchers.cpp +++ b/clang/lib/ASTMatchers/GtestMatchers.cpp @@ -38,6 +38,7 @@ static DeclarationMatcher getComparisonDecl(GtestCmp Cmp) { case GtestCmp::Lt: return functionDecl(hasName("::testing::internal::CmpHelperLT")); } + llvm_unreachable("Unhandled GtestCmp enum"); } static llvm::StringRef getAssertMacro(GtestCmp Cmp) { @@ -55,6 +56,7 @@ static llvm::StringRef getAssertMacro(GtestCmp Cmp) { case GtestCmp::Lt: return "ASSERT_LT"; } + llvm_unreachable("Unhandled GtestCmp enum"); } static llvm::StringRef getExpectMacro(GtestCmp Cmp) { @@ -72,6 +74,7 @@ static llvm::StringRef getExpectMacro(GtestCmp Cmp) { case GtestCmp::Lt: return "EXPECT_LT"; } + llvm_unreachable("Unhandled GtestCmp enum"); } // In general, AST matchers cannot match calls to macros. However, we can