From 2249ecee8d9a6237f51485bd39f01ba031575987 Mon Sep 17 00:00:00 2001 From: Luke Benes Date: Sun, 7 Nov 2021 00:06:55 +0300 Subject: [PATCH] [IR][ShuffleVector] Fix Wdangling-else warning in InstructionsTest 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. Differential Revision: https://reviews.llvm.org/D113346 --- llvm/unittests/IR/InstructionsTest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/unittests/IR/InstructionsTest.cpp b/llvm/unittests/IR/InstructionsTest.cpp index a4a9671..5b977ef 100644 --- a/llvm/unittests/IR/InstructionsTest.cpp +++ b/llvm/unittests/IR/InstructionsTest.cpp @@ -1204,8 +1204,9 @@ TEST(InstructionsTest, ShuffleMaskIsReplicationMask_Exhaustive_Correctness) { 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; -- 2.7.4