]> granicus.if.org Git - clang/commitdiff
Sema: simplify conditional execution (NFC)
authorSaleem Abdulrasool <compnerd@compnerd.org>
Sat, 11 Feb 2017 17:24:04 +0000 (17:24 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Sat, 11 Feb 2017 17:24:04 +0000 (17:24 +0000)
The conditional cast is unnecessary since we know that it will always
succeed.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@294853 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclCXX.cpp

index 2d5fd92cbb3121c9b92684da8b639eb4562dd569..6887962940e22875a1d6ac22a21d57c734ec9a5e 100644 (file)
@@ -3018,10 +3018,7 @@ Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D,
         return nullptr;
     }
 
-    // Check for any possible shadowed member variables
-    if (const auto *RD = cast<CXXRecordDecl>(CurContext))
-      CheckShadowInheritedFields(Loc, Name, RD);
-
+    CheckShadowInheritedFields(Loc, Name, cast<CXXRecordDecl>(CurContext));
   } else {
     Member = HandleDeclarator(S, D, TemplateParameterLists);
     if (!Member)