]> granicus.if.org Git - clang/commitdiff
[Sema] Remove a dead assignment, NFC.
authorVedant Kumar <vsk@apple.com>
Thu, 3 Nov 2016 06:35:16 +0000 (06:35 +0000)
committerVedant Kumar <vsk@apple.com>
Thu, 3 Nov 2016 06:35:16 +0000 (06:35 +0000)
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

lib/Sema/SemaExpr.cpp

index fdb5fb5bd289c6930fe182b2a0ff1d4c75aa3672..114dba31d93d03ad0b530b22cbcb82e81a6f9761 100644 (file)
@@ -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<MemberExpr>(E)) {