]> granicus.if.org Git - clang/commitdiff
Remove superfluous null pointer check. The pointer is used prior to this check.
authorTed Kremenek <kremenek@apple.com>
Thu, 21 Feb 2013 22:10:49 +0000 (22:10 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 21 Feb 2013 22:10:49 +0000 (22:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175807 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp

index 7411e809dbb9a2c5f97ec8592ddb138446293393..65bdd2a47fb91e977fdfb83c9e7d66acea6a3004 100644 (file)
@@ -1672,14 +1672,13 @@ bool Sema::DiagnoseEmptyLookup(Scope *S, CXXScopeSpec &SS, LookupResult &R,
             << SS.getRange()
             << FixItHint::CreateReplacement(Corrected.getCorrectionRange(),
                                             CorrectedStr);
-        if (ND) {
-          unsigned diag = isa<ImplicitParamDecl>(ND)
-            ? diag::note_implicit_param_decl
-            : diag::note_previous_decl;
 
-          Diag(ND->getLocation(), diag)
-            << CorrectedQuotedStr;
-        }
+        unsigned diag = isa<ImplicitParamDecl>(ND)
+          ? diag::note_implicit_param_decl
+          : diag::note_previous_decl;
+
+        Diag(ND->getLocation(), diag)
+          << CorrectedQuotedStr;
 
         // Tell the callee to try to recover.
         return false;