From 2a4be5ae1c466376351b82fcfeadb4b79c877575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 16 Jun 2019 19:01:45 +0200 Subject: [PATCH] Remove bailout. It hides lots of warnings for real code to avoid FP in unused templates. --- lib/checkclass.cpp | 7 ------- test/testconstructors.cpp | 3 ++- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index f30942e04..ba361a1d7 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -145,13 +145,6 @@ void CheckClass::constructors() if (!func.hasBody() || !(func.isConstructor() || func.type == Function::eOperatorEqual)) continue; - // Bail: If initializer list is not recognized as a variable or type then skip since parsing is incomplete - if (func.type == Function::eConstructor) { - const Token *initList = func.constructorMemberInitialization(); - if (Token::Match(initList, ": %name% (") && initList->next()->tokType() == Token::eName) - break; - } - // Mark all variables not used clearAllVar(usage); diff --git a/test/testconstructors.cpp b/test/testconstructors.cpp index b035e2687..fc6b8d41b 100644 --- a/test/testconstructors.cpp +++ b/test/testconstructors.cpp @@ -3885,7 +3885,8 @@ private: "};\n" "template\n" "A>::A() : m_value(false) {}\n"); - ASSERT_EQUALS("", errout.str()); + // TODO: Avoid FP somehow + TODO_ASSERT_EQUALS("", "[test.cpp:10]: (warning) Member variable 'A::m_value' is not initialized in the constructor.\n", errout.str()); } };