Skip to content

Revert "testrunner: use structs with designated initialization to pass options (#4975)"#5296

Closed
pfultz2 wants to merge 1 commit intocppcheck-opensource:mainfrom
pfultz2:revert-5d201c4e871585d11474d129df483ec201eae316
Closed

Revert "testrunner: use structs with designated initialization to pass options (#4975)"#5296
pfultz2 wants to merge 1 commit intocppcheck-opensource:mainfrom
pfultz2:revert-5d201c4e871585d11474d129df483ec201eae316

Conversation

@pfultz2
Copy link
Copy Markdown
Contributor

@pfultz2 pfultz2 commented Aug 6, 2023

This reverts commit 5d201c4. This causes compile errors on clang++-13:

cppcheck/test/testthreadexecutor.cpp:61:110: error: default member initializer for 'showtime' needed within definition of enclosing class 'TestThreadExecutor' outside of member functions
    void check(unsigned int jobs, int files, int result, const std::string &data, const CheckOptions &opt = {}) {
                                                                                                             ^
cppcheck/test/testthreadexecutor.cpp:52:24: note: default member initializer declared here
        SHOWTIME_MODES showtime = SHOWTIME_MODES::SHOWTIME_NONE;
                       ^
cppcheck/test/testthreadexecutor.cpp:61:103: warning: unused parameter 'opt' [-Wunused-parameter]
    void check(unsigned int jobs, int files, int result, const std::string &data, const CheckOptions &opt = {}) {
                                                                                                      ^
cppcheck/test/testprocessexecutor.cpp:61:110: error: default member initializer for 'showtime' needed within definition of enclosing class 'TestProcessExecutor' outside of member functions
    void check(unsigned int jobs, int files, int result, const std::string &data, const CheckOptions &opt = {}) {
                                                                                                             ^
cppcheck/test/testprocessexecutor.cpp:52:24: note: default member initializer declared here
        SHOWTIME_MODES showtime = SHOWTIME_MODES::SHOWTIME_NONE;
                       ^
cppcheck/test/testprocessexecutor.cpp:61:103: warning: unused parameter 'opt' [-Wunused-parameter]
    void check(unsigned int jobs, int files, int result, const std::string &data, const CheckOptions &opt = {}) {
                                                                                                      ^
cppcheck/test/testsingleexecutor.cpp:72:91: error: default member initializer for 'showtime' needed within definition of enclosing class 'TestSingleExecutorBase' outside of member functions
    void check(int files, int result, const std::string &data, const CheckOptions &opt = {}) {
                                                                                          ^
cppcheck/test/testsingleexecutor.cpp:67:24: note: default member initializer declared here
        SHOWTIME_MODES showtime = SHOWTIME_MODES::SHOWTIME_NONE;
                       ^
cppcheck/test/testsingleexecutor.cpp:72:84: warning: unused parameter 'opt' [-Wunused-parameter]
    void check(int files, int result, const std::string &data, const CheckOptions &opt = {}) {
                                                                                   ^

I revert this for now, until a better solution can be found.

@pfultz2
Copy link
Copy Markdown
Contributor Author

pfultz2 commented Aug 6, 2023

I found a workaround in #5297. So this may not be needed.

@firewave
Copy link
Copy Markdown
Collaborator

firewave commented Aug 6, 2023

That's what I added the noexcept workaround for. So older Clang behaves like GCC 4.8.

@pfultz2
Copy link
Copy Markdown
Contributor Author

pfultz2 commented Aug 7, 2023

That's what I added the noexcept workaround for. So older Clang behaves like GCC 4.8.

Yea that still didnt fix the issue for clang++-13 on ubuntu.

@firewave
Copy link
Copy Markdown
Collaborator

firewave commented Aug 8, 2023

Closing as it is superseded by #5297.

@firewave firewave closed this Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants