From 7e84aa1b81e72d44bcc58ffe1731bfc7abb73ce0 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sun, 20 Dec 2020 11:21:08 +0000 Subject: [PATCH] Fix MSVC "not all control paths return a value" warnings. NFCI. Add missing llvm_unreachable()'s after each all-enums switch statement. --- clang/lib/Sema/SemaTemplate.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 74a31c0..9d31a87 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -7637,6 +7637,7 @@ static Expr *BuildExpressionFromNonTypeTemplateArgumentValue( auto *OVE = new (S.Context) OpaqueValueExpr(Loc, T, VK); return ConstantExpr::Create(S.Context, OVE, Val); } + llvm_unreachable("Unhandled APValue::ValueKind enum"); } ExprResult @@ -7666,6 +7667,7 @@ Sema::BuildExpressionFromNonTypeTemplateArgument(const TemplateArgument &Arg, return BuildExpressionFromNonTypeTemplateArgumentValue( *this, Arg.getUncommonValueType(), Arg.getAsUncommonValue(), Loc); } + llvm_unreachable("Unhandled TemplateArgument::ArgKind enum"); } /// Match two template parameters within template parameter lists. -- 2.7.4