From 38af865560c87df2c3eec2432163cf11b8236b38 Mon Sep 17 00:00:00 2001 From: PKEuS Date: Mon, 29 Sep 2014 16:49:20 +0200 Subject: [PATCH] Fixed false positive: Member variable not initialized in the constructor with array and (*this) (#5754) --- lib/checkclass.cpp | 4 +++- test/testconstructors.cpp | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index 891714cc8..ffecf5748 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -528,7 +528,7 @@ void CheckClass::initializeVarList(const Function &func, std::listnext(), "::| %var%") && - !Token::Match(ftok->next(), "this . %var%") && + !Token::Match(ftok->next(), "*| this . %var%") && !Token::Match(ftok->next(), "* %var% =") && !Token::Match(ftok->next(), "( * this ) . %var%")) continue; @@ -700,6 +700,8 @@ void CheckClass::initializeVarList(const Function &func, std::listname = '\\0';}\n" + "\n" + "private:\n" + " char name[255];\n" + "};"); + ASSERT_EQUALS("", errout.str()); } void uninitVarArray3() {