r359550 - Fix gcc "-Wdangling-else" warnings. NFCI.

Simon Pilgrim via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 30 03:57:02 PDT 2019


Author: rksimon
Date: Tue Apr 30 03:57:02 2019
New Revision: 359550

URL: http://llvm.org/viewvc/llvm-project?rev=359550&view=rev
Log:
Fix gcc "-Wdangling-else" warnings. NFCI.

Modified:
    cfe/trunk/unittests/AST/ASTImporterTest.cpp

Modified: cfe/trunk/unittests/AST/ASTImporterTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/AST/ASTImporterTest.cpp?rev=359550&r1=359549&r2=359550&view=diff
==============================================================================
--- cfe/trunk/unittests/AST/ASTImporterTest.cpp (original)
+++ cfe/trunk/unittests/AST/ASTImporterTest.cpp Tue Apr 30 03:57:02 2019
@@ -4137,8 +4137,9 @@ struct RedeclChain : ASTImporterOptionSp
     auto *ToD = LastDeclMatcher<DeclTy>().match(ToTU, getPattern());
     EXPECT_TRUE(ImportedD == ToD);
     EXPECT_FALSE(ToD->isThisDeclarationADefinition());
-    if (auto *ToT = dyn_cast<TemplateDecl>(ToD))
+    if (auto *ToT = dyn_cast<TemplateDecl>(ToD)) {
       EXPECT_TRUE(ToT->getTemplatedDecl());
+    }
   }
 
   void TypedTest_DefinitionShouldBeImportedAsADefinition() {
@@ -4152,8 +4153,9 @@ struct RedeclChain : ASTImporterOptionSp
     EXPECT_EQ(DeclCounter<DeclTy>().match(ToTU, getPattern()), 1u);
     auto *ToD = LastDeclMatcher<DeclTy>().match(ToTU, getPattern());
     EXPECT_TRUE(ToD->isThisDeclarationADefinition());
-    if (auto *ToT = dyn_cast<TemplateDecl>(ToD))
+    if (auto *ToT = dyn_cast<TemplateDecl>(ToD)) {
       EXPECT_TRUE(ToT->getTemplatedDecl());
+    }
   }
 
   void TypedTest_ImportPrototypeAfterImportedPrototype() {
@@ -4266,8 +4268,9 @@ struct RedeclChain : ASTImporterOptionSp
     auto *To0 = FirstDeclMatcher<DeclTy>().match(ToTU, getPattern());
     EXPECT_TRUE(Imported0 == To0);
     EXPECT_TRUE(To0->isThisDeclarationADefinition());
-    if (auto *ToT0 = dyn_cast<TemplateDecl>(To0))
+    if (auto *ToT0 = dyn_cast<TemplateDecl>(To0)) {
       EXPECT_TRUE(ToT0->getTemplatedDecl());
+    }
   }
 
   void TypedTest_ImportDefinitionThenPrototype() {




More information about the cfe-commits mailing list