From 03b632e6f8dcba415b7ad1fe17f5af74f1d9a5fc Mon Sep 17 00:00:00 2001 From: ouuan Date: Fri, 31 Jan 2020 10:16:43 +0800 Subject: [PATCH] fix(TestCases): Fix CE about static const member This is reported in coder3101#129. See https://stackoverflow.com/questions/27258344/compiler-error-or-correct-behavior-for-static-const-member-variable-variadic-te Because > If a non-volatile const static data member is of integral or > enumeration type, its declaration in the class definition can > specify a brace-or-equal-initializer in which every > initializer-clause that is an assignment expression is a constant > expression (5.19). [...] The member shall still be defined in a > namespace scope if it is odr-used (3.2) in the program and the > namespace scope definition shall not contain an initializer. another definition in the .cpp file with namespace is required. This should be a better solution than coder3101#135. --- src/TestCases.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/TestCases.cpp b/src/TestCases.cpp index d5905403c..9f7df808c 100644 --- a/src/TestCases.cpp +++ b/src/TestCases.cpp @@ -420,6 +420,8 @@ bool TestCase::isPass() const return true; } +const int TestCases::MAX_NUMBER_OF_TESTCASES; + TestCases::TestCases(MessageLogger *logger, QWidget *parent) : QWidget(parent), log(logger) { mainLayout = new QVBoxLayout(this);