Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions test/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,16 @@ class PreprocessorHelper
#define dinit(T, ...) \
([&] { T ${}; __VA_ARGS__; return $; }())

#if (defined(__GNUC__) && (__GNUC__ >= 5)) || defined(__clang__)
// work around Clang compilation error
// Default construct object to avoid bug in clang
// error: default member initializer for 'y' needed within definition of enclosing class 'X' outside of member functions
// work around GCC compilation error
// error: default member initializer for ‘x::y::z’ required before the end of its enclosing class
// see https://stackoverflow.com/questions/53408962
#define DINIT_NOEXCEPT noexcept
#else
// work around GCC 4.8 compilation error
// error: function 'x()' defaulted on its first declaration with an exception-specification that differs from the implicit declaration 'x()'
#define DINIT_NOEXCEPT
#endif
struct make_default_obj
Comment thread
firewave marked this conversation as resolved.
{
template<class T>
operator T() const // NOLINT
{
return T{};
}
};

#endif // helpersH
4 changes: 2 additions & 2 deletions test/testprocessexecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class TestProcessExecutor : public TestFixture {

struct CheckOptions
{
CheckOptions() DINIT_NOEXCEPT = default;
CheckOptions() = default;
SHOWTIME_MODES showtime = SHOWTIME_MODES::SHOWTIME_NONE;
const char* plistOutput = nullptr;
std::vector<std::string> filesList;
Expand All @@ -58,7 +58,7 @@ class TestProcessExecutor : public TestFixture {
* Execute check using n jobs for y files which are have
* identical data, given within data.
*/
void check(unsigned int jobs, int files, int result, const std::string &data, const CheckOptions &opt = {}) {
void check(unsigned int jobs, int files, int result, const std::string &data, const CheckOptions& opt = make_default_obj{}) {
errout.str("");
output.str("");

Expand Down
4 changes: 2 additions & 2 deletions test/testsingleexecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ class TestSingleExecutorBase : public TestFixture {

struct CheckOptions
{
CheckOptions() DINIT_NOEXCEPT = default;
CheckOptions() = default;
SHOWTIME_MODES showtime = SHOWTIME_MODES::SHOWTIME_NONE;
const char* plistOutput = nullptr;
std::vector<std::string> filesList;
};

void check(int files, int result, const std::string &data, const CheckOptions &opt = {}) {
void check(int files, int result, const std::string &data, const CheckOptions& opt = make_default_obj{}) {
errout.str("");
output.str("");
settings.project.fileSettings.clear();
Expand Down
4 changes: 2 additions & 2 deletions test/testthreadexecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class TestThreadExecutor : public TestFixture {

struct CheckOptions
{
CheckOptions() DINIT_NOEXCEPT = default;
CheckOptions() = default;
SHOWTIME_MODES showtime = SHOWTIME_MODES::SHOWTIME_NONE;
const char* plistOutput = nullptr;
std::vector<std::string> filesList;
Expand All @@ -58,7 +58,7 @@ class TestThreadExecutor : public TestFixture {
* Execute check using n jobs for y files which are have
* identical data, given within data.
*/
void check(unsigned int jobs, int files, int result, const std::string &data, const CheckOptions &opt = {}) {
void check(unsigned int jobs, int files, int result, const std::string &data, const CheckOptions& opt = make_default_obj{}) {
errout.str("");
output.str("");

Expand Down