From ed104d547f71c27c3402866653a9cc40e269f804 Mon Sep 17 00:00:00 2001 From: James Moore Date: Sat, 11 Jan 2020 12:40:03 +0000 Subject: [PATCH] Fixed clang build --- test/src/unit-allocator.cpp | 5 +++++ test/src/unit-class_const_iterator.cpp | 5 +++++ test/src/unit-class_iterator.cpp | 5 +++++ test/src/unit-class_lexer.cpp | 5 +++++ test/src/unit-class_parser.cpp | 5 +++++ test/src/unit-constructor1.cpp | 5 +++++ test/src/unit-convenience.cpp | 5 +++++ test/src/unit-conversions.cpp | 5 +++++ test/src/unit-iterators1.cpp | 5 +++++ test/src/unit-json_pointer.cpp | 5 +++++ test/src/unit-noexcept.cpp | 5 +++++ test/src/unit-regression.cpp | 5 +++++ test/src/unit-unicode.cpp | 5 +++++ 13 files changed, 65 insertions(+) diff --git a/test/src/unit-allocator.cpp b/test/src/unit-allocator.cpp index 3518c4ae7..050429e81 100644 --- a/test/src/unit-allocator.cpp +++ b/test/src/unit-allocator.cpp @@ -29,11 +29,16 @@ SOFTWARE. #include "doctest_compatibility.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-macro" + #define private public #include using nlohmann::json; #undef private +#pragma clang diagnostic pop + namespace { // special test case to check if memory is leaked if constructor throws diff --git a/test/src/unit-class_const_iterator.cpp b/test/src/unit-class_const_iterator.cpp index fc8e40c6e..ea63e9c7d 100644 --- a/test/src/unit-class_const_iterator.cpp +++ b/test/src/unit-class_const_iterator.cpp @@ -29,11 +29,16 @@ SOFTWARE. #include "doctest_compatibility.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-macro" + #define private public #include using nlohmann::json; #undef private +#pragma clang diagnostic pop + TEST_CASE("const_iterator class") { SECTION("construction") diff --git a/test/src/unit-class_iterator.cpp b/test/src/unit-class_iterator.cpp index 7c572a340..71ea5dfa3 100644 --- a/test/src/unit-class_iterator.cpp +++ b/test/src/unit-class_iterator.cpp @@ -29,11 +29,16 @@ SOFTWARE. #include "doctest_compatibility.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-macro" + #define private public #include using nlohmann::json; #undef private +#pragma clang diagnostic pop + TEST_CASE("iterator class") { SECTION("construction") diff --git a/test/src/unit-class_lexer.cpp b/test/src/unit-class_lexer.cpp index 4aad6d784..d17589af0 100644 --- a/test/src/unit-class_lexer.cpp +++ b/test/src/unit-class_lexer.cpp @@ -29,11 +29,16 @@ SOFTWARE. #include "doctest_compatibility.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-macro" + #define private public #include using nlohmann::json; #undef private +#pragma clang diagnostic pop + namespace { // shortcut to scan a string literal diff --git a/test/src/unit-class_parser.cpp b/test/src/unit-class_parser.cpp index d4efa2071..7e66ad2d7 100644 --- a/test/src/unit-class_parser.cpp +++ b/test/src/unit-class_parser.cpp @@ -29,11 +29,16 @@ SOFTWARE. #include "doctest_compatibility.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-macro" + #define private public #include using nlohmann::json; #undef private +#pragma clang diagnostic pop + #include namespace diff --git a/test/src/unit-constructor1.cpp b/test/src/unit-constructor1.cpp index 4ce916764..2700a9919 100644 --- a/test/src/unit-constructor1.cpp +++ b/test/src/unit-constructor1.cpp @@ -30,11 +30,16 @@ SOFTWARE. #include "doctest_compatibility.h" DOCTEST_GCC_SUPPRESS_WARNING("-Wfloat-equal") +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-macro" + #define private public #include using nlohmann::json; #undef private +#pragma clang diagnostic pop + #include #include #include diff --git a/test/src/unit-convenience.cpp b/test/src/unit-convenience.cpp index 1c61fae14..7c468ad27 100644 --- a/test/src/unit-convenience.cpp +++ b/test/src/unit-convenience.cpp @@ -29,11 +29,16 @@ SOFTWARE. #include "doctest_compatibility.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-macro" + #define private public #include using nlohmann::json; #undef private +#pragma clang diagnostic pop + #include namespace diff --git a/test/src/unit-conversions.cpp b/test/src/unit-conversions.cpp index 8477cf639..539a1f839 100644 --- a/test/src/unit-conversions.cpp +++ b/test/src/unit-conversions.cpp @@ -29,11 +29,16 @@ SOFTWARE. #include "doctest_compatibility.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-macro" + #define private public #include using nlohmann::json; #undef private +#pragma clang diagnostic pop + #include #include #include diff --git a/test/src/unit-iterators1.cpp b/test/src/unit-iterators1.cpp index cbdc0d45f..1f6eb241f 100644 --- a/test/src/unit-iterators1.cpp +++ b/test/src/unit-iterators1.cpp @@ -29,11 +29,16 @@ SOFTWARE. #include "doctest_compatibility.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-macro" + #define private public #include using nlohmann::json; #undef private +#pragma clang diagnostic pop + TEST_CASE("iterators 1") { SECTION("basic behavior") diff --git a/test/src/unit-json_pointer.cpp b/test/src/unit-json_pointer.cpp index 3cfd8dadc..486f92d7f 100644 --- a/test/src/unit-json_pointer.cpp +++ b/test/src/unit-json_pointer.cpp @@ -29,11 +29,16 @@ SOFTWARE. #include "doctest_compatibility.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-macro" + #define private public #include using nlohmann::json; #undef private +#pragma clang diagnostic pop + TEST_CASE("JSON pointers") { SECTION("errors") diff --git a/test/src/unit-noexcept.cpp b/test/src/unit-noexcept.cpp index 26b2d4819..a4fec5377 100644 --- a/test/src/unit-noexcept.cpp +++ b/test/src/unit-noexcept.cpp @@ -42,12 +42,17 @@ enum test struct pod {}; struct pod_bis {}; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunneeded-internal-declaration" + void to_json(json&, pod) noexcept{} void to_json(json&, pod_bis){} void from_json(const json&, pod) noexcept{} void from_json(const json&, pod_bis){} static json j; +#pragma clang diagnostic pop + static_assert(noexcept(json{}), ""); static_assert(noexcept(nlohmann::to_json(j, 2)), ""); static_assert(noexcept(nlohmann::to_json(j, 2.5)), ""); diff --git a/test/src/unit-regression.cpp b/test/src/unit-regression.cpp index f5139264c..c41720f93 100644 --- a/test/src/unit-regression.cpp +++ b/test/src/unit-regression.cpp @@ -33,11 +33,16 @@ DOCTEST_GCC_SUPPRESS_WARNING("-Wfloat-equal") // for some reason including this after the json header leads to linker errors with VS 2017... #include +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-macro" + #define private public #include using nlohmann::json; #undef private +#pragma clang diagnostic pop + #include #include #include diff --git a/test/src/unit-unicode.cpp b/test/src/unit-unicode.cpp index a3d997631..3487c3fbb 100644 --- a/test/src/unit-unicode.cpp +++ b/test/src/unit-unicode.cpp @@ -32,11 +32,16 @@ SOFTWARE. // for some reason including this after the json header leads to linker errors with VS 2017... #include +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-macro" + #define private public #include using nlohmann::json; #undef private +#pragma clang diagnostic pop + #include #include #include