Skip to content

Commit

Permalink
lets see which compilers are able to build the following code in c++1…
Browse files Browse the repository at this point in the history
…1 mode - here I'm using all features I'm interested in. Based on this I shall update the supported compilers matrix and CI builds...

relates #137
  • Loading branch information
onqtam committed Aug 23, 2018
1 parent be46017 commit 0c764a7
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
37 changes: 37 additions & 0 deletions doctest/doctest.h
Original file line number Diff line number Diff line change
Expand Up @@ -5109,6 +5109,43 @@ int registerReporter(const char* name, int priority, IReporter* r) {
int main(int argc, char** argv) { return doctest::Context(argc, argv).run(); }
#endif // DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN

DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN
//#include <thread>
#include <atomic>
#include <mutex>
DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END

struct A {
int a = 5;
A();
A(const A&) = delete;
A& operator=(const A&);
};

A::A() = default;
A& A::operator=(const A&) = default;

enum class hello_cpp11_enums {
val1,
val2
};

static void f() {
std::mutex logMutex;
std::lock_guard<std::mutex> lock(logMutex);

A a;

std::vector<int> v = {4,5,6};
for(auto& curr : v)
std::cout << curr;

f();

std::atomic<int> ai;
ai.exchange(6);
}

DOCTEST_CLANG_SUPPRESS_WARNING_POP
DOCTEST_MSVC_SUPPRESS_WARNING_POP
DOCTEST_GCC_SUPPRESS_WARNING_POP
Expand Down
37 changes: 37 additions & 0 deletions doctest/parts/doctest_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2358,6 +2358,43 @@ int registerReporter(const char* name, int priority, IReporter* r) {
int main(int argc, char** argv) { return doctest::Context(argc, argv).run(); }
#endif // DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN

DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN
//#include <thread>
#include <atomic>
#include <mutex>
DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END

struct A {
int a = 5;
A();
A(const A&) = delete;
A& operator=(const A&);
};

A::A() = default;
A& A::operator=(const A&) = default;

enum class hello_cpp11_enums {
val1,
val2
};

static void f() {
std::mutex logMutex;
std::lock_guard<std::mutex> lock(logMutex);

A a;

std::vector<int> v = {4,5,6};
for(auto& curr : v)
std::cout << curr;

f();

std::atomic<int> ai;
ai.exchange(6);
}

DOCTEST_CLANG_SUPPRESS_WARNING_POP
DOCTEST_MSVC_SUPPRESS_WARNING_POP
DOCTEST_GCC_SUPPRESS_WARNING_POP
Expand Down

0 comments on commit 0c764a7

Please sign in to comment.