From fba82081341340a668dd4f2d8b10ecd1fe86682c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 22 Apr 2018 17:04:54 +0200 Subject: [PATCH] CheckUninitVar: Use isLikelyStreamRead --- lib/checkuninitvar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkuninitvar.cpp b/lib/checkuninitvar.cpp index fd3122beb..a4ec1af09 100644 --- a/lib/checkuninitvar.cpp +++ b/lib/checkuninitvar.cpp @@ -1110,7 +1110,7 @@ bool CheckUninitVar::isMemberVariableAssignment(const Token *tok, const std::str return true; else if (Token::Match(tok->tokAt(-2), "[(,=] &")) return true; - else if (Token::Match(tok->tokAt(-2), "%name% >>") && Token::Match(tok->tokAt(3), ";|>>")) // #6680 + else if (isLikelyStreamRead(_tokenizer->isCPP(), tok->previous())) return true; else if ((tok->previous() && tok->previous()->isConstOp()) || Token::Match(tok->previous(), "[|=")) ; // member variable usage