[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
This commit is contained in:
Vedant Kumar 2016-11-03 06:35:16 +00:00
parent 7b9cc1474f
commit e03e5953f6
1 changed files with 2 additions and 3 deletions

View 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)) {