From: Vedant Kumar Date: Thu, 3 Nov 2016 06:35:16 +0000 (+0000) Subject: [Sema] Remove a dead assignment, NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=54a3b8848e8917168e0177ca93755853f66a0693;p=clang [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.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285879 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index fdb5fb5bd2..114dba31d9 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/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)) {