From e03e5953f6094901468708dce02a2d8dc76c1f2a Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Thu, 3 Nov 2016 06:35:16 +0000 Subject: [PATCH] [Sema] Remove a dead assignment, NFC. The assignment to NextIsDereference is either followed by (1) another, unrelated assignment to NextIsDereference or by (2) an early loop exit. Found by clang's static analyzer: http://llvm.org/reports/scan-build (While we're at it fix a typo.) llvm-svn: 285879 --- clang/lib/Sema/SemaExpr.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index fdb5fb5bd289..114dba31d93d 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -9880,15 +9880,14 @@ static void DiagnoseConstAssignment(Sema &S, const Expr *E, // a note to the error. bool DiagnosticEmitted = false; - // Track if the current expression is the result of a derefence, and if the - // next checked expression is the result of a derefence. + // Track if the current expression is the result of a dereference, and if the + // next checked expression is the result of a dereference. bool IsDereference = false; bool NextIsDereference = false; // Loop to process MemberExpr chains. while (true) { IsDereference = NextIsDereference; - NextIsDereference = false; E = E->IgnoreParenImpCasts(); if (const MemberExpr *ME = dyn_cast(E)) {