Author: Simon Pilgrim
Date: 2020-12-20T11:32:40Z
New Revision: 7e84aa1b81e72d44bcc58ffe1731bfc7abb73ce0

URL: 
https://github.com/llvm/llvm-project/commit/7e84aa1b81e72d44bcc58ffe1731bfc7abb73ce0
DIFF: 
https://github.com/llvm/llvm-project/commit/7e84aa1b81e72d44bcc58ffe1731bfc7abb73ce0.diff

LOG: Fix MSVC "not all control paths return a value" warnings. NFCI.

Add missing llvm_unreachable()'s after each all-enums switch statement.

Added: 
    

Modified: 
    clang/lib/Sema/SemaTemplate.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index 74a31c0a1b65..9d31a8701241 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.


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to