[PATCH] D113346: [IR][ShuffleVector] Fix Wdangling-else warning in InstructionsTest

Luke Benes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 6 08:49:09 PDT 2021


lbenes created this revision.
lbenes added a reviewer: lebedev.ri.
lbenes requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Fix a dangling else that gcc-11 warned about. The EXPECT_EQ macro
expands to an if-else, so the whole construction contains a hidden
dangling else.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113346

Files:
  llvm/unittests/IR/InstructionsTest.cpp


Index: llvm/unittests/IR/InstructionsTest.cpp
===================================================================
--- llvm/unittests/IR/InstructionsTest.cpp
+++ llvm/unittests/IR/InstructionsTest.cpp
@@ -1204,8 +1204,9 @@
         int Elt = std::get<0>(I);
         int ActualElt = std::get<0>(I);
 
-        if (Elt != -1)
+        if (Elt != -1) {
           EXPECT_EQ(Elt, ActualElt);
+        }
       }
 
       return /*Abort=*/false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113346.385281.patch
Type: text/x-patch
Size: 441 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211106/033732f5/attachment.bin>


More information about the llvm-commits mailing list