From 2edaf4e9735d738657f9560473cec484f41b6f47 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Thu, 21 Feb 2013 22:10:49 +0000 Subject: [PATCH] Remove superfluous null pointer check. The pointer is used prior to this check. llvm-svn: 175807 --- clang/lib/Sema/SemaExpr.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 7411e80..65bdd2a 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -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(ND) - ? diag::note_implicit_param_decl - : diag::note_previous_decl; - Diag(ND->getLocation(), diag) - << CorrectedQuotedStr; - } + unsigned diag = isa(ND) + ? diag::note_implicit_param_decl + : diag::note_previous_decl; + + Diag(ND->getLocation(), diag) + << CorrectedQuotedStr; // Tell the callee to try to recover. return false; -- 2.7.4