r285879 - [Sema] Remove a dead assignment, NFC.

Vedant Kumar via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 2 23:35:17 PDT 2016


Author: vedantk
Date: Thu Nov  3 01:35:16 2016
New Revision: 285879

URL: http://llvm.org/viewvc/llvm-project?rev=285879&view=rev
Log:
[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.)

Modified:
    cfe/trunk/lib/Sema/SemaExpr.cpp

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=285879&r1=285878&r2=285879&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Thu Nov  3 01:35:16 2016
@@ -9880,15 +9880,14 @@ static void DiagnoseConstAssignment(Sema
   // 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)) {




More information about the cfe-commits mailing list