From d3f7fc92f24824e8c8bd81840a18fb358ccc725a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 23 Aug 2019 15:23:49 +0200 Subject: [PATCH] Quick fix to make Travis happy --- lib/checkother.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 18fbf69fd..68aff5a2c 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -439,8 +439,8 @@ void CheckOther::checkRedundantAssignment() [&](const Token *rhs) { if (Token::Match(rhs, "{ 0 }")) return ChildrenToVisit::none; - if (Token::Match(rhs, "0|NULL|nullptr")) - return ChildrenToVisit::op1_and_op2; + if (Token::Match(rhs, "%str%|%num%|%name%") && !rhs->varId()) + return ChildrenToVisit::none; if (rhs->isCast()) return ChildrenToVisit::op2; trivial = false;