Skip to content

Commit

Permalink
fix(TestCases): Fix CE about static const member
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ouuan committed Jan 31, 2020
1 parent d0ff568 commit 03b632e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/TestCases.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 03b632e

Please sign in to comment.