apelete updated this revision to Diff 57560. apelete added a comment. [scan-build] fix dead store warnings emitted on clang code base
Changes since last revision: - lib/Sema/SemaLookup.cpp: remove changes since they were already applied upstream, - lib/Sema/SemaExpr.cpp: move 'IsDereference' and 'NextIsDereference' variables into the code block where they are used. http://reviews.llvm.org/D19829 Files: lib/Sema/SemaDeclCXX.cpp lib/Sema/SemaExpr.cpp lib/Sema/SemaTemplate.cpp Index: lib/Sema/SemaTemplate.cpp =================================================================== --- lib/Sema/SemaTemplate.cpp +++ lib/Sema/SemaTemplate.cpp @@ -6248,8 +6248,6 @@ SourceRange(TemplateParams->getTemplateLoc(), TemplateParams->getRAngleLoc())) << SourceRange(LAngleLoc, RAngleLoc); - else - isExplicitSpecialization = true; } else { assert(TUK == TUK_Friend && "should have a 'template<>' for this decl"); } Index: lib/Sema/SemaExpr.cpp =================================================================== --- lib/Sema/SemaExpr.cpp +++ lib/Sema/SemaExpr.cpp @@ -9692,16 +9692,16 @@ // Track if the current expression is the result of a derefence, and if the // next checked expression is the result of a derefence. + // These variables are only updated when processing MemberExpr + // chains in the loop below. 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)) { + IsDereference = NextIsDereference; NextIsDereference = ME->isArrow(); const ValueDecl *VD = ME->getMemberDecl(); if (const FieldDecl *Field = dyn_cast<FieldDecl>(VD)) { Index: lib/Sema/SemaDeclCXX.cpp =================================================================== --- lib/Sema/SemaDeclCXX.cpp +++ lib/Sema/SemaDeclCXX.cpp @@ -12470,6 +12470,7 @@ Diag(TemplateParams->getTemplateLoc(), diag::err_template_tag_noparams) << TypeWithKeyword::getTagTypeKindName(Kind) << Name; isExplicitSpecialization = true; + (void) isExplicitSpecialization; } }
Index: lib/Sema/SemaTemplate.cpp =================================================================== --- lib/Sema/SemaTemplate.cpp +++ lib/Sema/SemaTemplate.cpp @@ -6248,8 +6248,6 @@ SourceRange(TemplateParams->getTemplateLoc(), TemplateParams->getRAngleLoc())) << SourceRange(LAngleLoc, RAngleLoc); - else - isExplicitSpecialization = true; } else { assert(TUK == TUK_Friend && "should have a 'template<>' for this decl"); } Index: lib/Sema/SemaExpr.cpp =================================================================== --- lib/Sema/SemaExpr.cpp +++ lib/Sema/SemaExpr.cpp @@ -9692,16 +9692,16 @@ // Track if the current expression is the result of a derefence, and if the // next checked expression is the result of a derefence. + // These variables are only updated when processing MemberExpr + // chains in the loop below. 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)) { + IsDereference = NextIsDereference; NextIsDereference = ME->isArrow(); const ValueDecl *VD = ME->getMemberDecl(); if (const FieldDecl *Field = dyn_cast<FieldDecl>(VD)) { Index: lib/Sema/SemaDeclCXX.cpp =================================================================== --- lib/Sema/SemaDeclCXX.cpp +++ lib/Sema/SemaDeclCXX.cpp @@ -12470,6 +12470,7 @@ Diag(TemplateParams->getTemplateLoc(), diag::err_template_tag_noparams) << TypeWithKeyword::getTagTypeKindName(Kind) << Name; isExplicitSpecialization = true; + (void) isExplicitSpecialization; } }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits