[llvm] 13be6ee - Fix MSVC discarded return value warnings. NFC.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 2 09:15:17 PDT 2024


Author: Simon Pilgrim
Date: 2024-07-02T17:14:39+01:00
New Revision: 13be6ee7da048acff9953db92486f5c2147af3ed

URL: https://github.com/llvm/llvm-project/commit/13be6ee7da048acff9953db92486f5c2147af3ed
DIFF: https://github.com/llvm/llvm-project/commit/13be6ee7da048acff9953db92486f5c2147af3ed.diff

LOG: Fix MSVC discarded return value warnings. NFC.

"C4858 This function constructs an object wrapped by a smart pointer and has no other effects; it is not useful to call this function and discard the return value."

Added: 
    

Modified: 
    llvm/unittests/Analysis/MLModelRunnerTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/Analysis/MLModelRunnerTest.cpp b/llvm/unittests/Analysis/MLModelRunnerTest.cpp
index 87b37f81163a4..d3c9dcc56b4c3 100644
--- a/llvm/unittests/Analysis/MLModelRunnerTest.cpp
+++ b/llvm/unittests/Analysis/MLModelRunnerTest.cpp
@@ -198,7 +198,7 @@ TEST(ReleaseModelRunner, ModelSelectorNoInputFeaturePresent) {
   LLVMContext Ctx;
   std::vector<TensorSpec> Inputs{TensorSpec::createSpec<int64_t>("a", {1}),
                                  TensorSpec::createSpec<int64_t>("b", {1})};
-  EXPECT_DEATH(std::make_unique<ReleaseModeModelRunner<AdditionAOTModel>>(
+  EXPECT_DEATH((void)std::make_unique<ReleaseModeModelRunner<AdditionAOTModel>>(
                    Ctx, Inputs, "", makeOptions().setModelSelector(M2Selector)),
                "A model selector was specified but the underlying model does "
                "not expose a model_selector input");
@@ -209,7 +209,7 @@ TEST(ReleaseModelRunner, ModelSelectorNoSelectorGiven) {
   std::vector<TensorSpec> Inputs{TensorSpec::createSpec<int64_t>("a", {1}),
                                  TensorSpec::createSpec<int64_t>("b", {1})};
   EXPECT_DEATH(
-      std::make_unique<ReleaseModeModelRunner<ComposedAOTModel>>(
+      (void)std::make_unique<ReleaseModeModelRunner<ComposedAOTModel>>(
           Ctx, Inputs, "", makeOptions()),
       "A model selector was not specified but the underlying model requires "
       "selecting one because it exposes a model_selector input");


        


More information about the llvm-commits mailing list