Fixed clang build
This commit is contained in:
parent
658e613902
commit
ed104d547f
@ -29,11 +29,16 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "doctest_compatibility.h"
|
#include "doctest_compatibility.h"
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||||
|
|
||||||
#define private public
|
#define private public
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
using nlohmann::json;
|
using nlohmann::json;
|
||||||
#undef private
|
#undef private
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
// special test case to check if memory is leaked if constructor throws
|
// special test case to check if memory is leaked if constructor throws
|
||||||
|
|||||||
@ -29,11 +29,16 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "doctest_compatibility.h"
|
#include "doctest_compatibility.h"
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||||
|
|
||||||
#define private public
|
#define private public
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
using nlohmann::json;
|
using nlohmann::json;
|
||||||
#undef private
|
#undef private
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
TEST_CASE("const_iterator class")
|
TEST_CASE("const_iterator class")
|
||||||
{
|
{
|
||||||
SECTION("construction")
|
SECTION("construction")
|
||||||
|
|||||||
@ -29,11 +29,16 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "doctest_compatibility.h"
|
#include "doctest_compatibility.h"
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||||
|
|
||||||
#define private public
|
#define private public
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
using nlohmann::json;
|
using nlohmann::json;
|
||||||
#undef private
|
#undef private
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
TEST_CASE("iterator class")
|
TEST_CASE("iterator class")
|
||||||
{
|
{
|
||||||
SECTION("construction")
|
SECTION("construction")
|
||||||
|
|||||||
@ -29,11 +29,16 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "doctest_compatibility.h"
|
#include "doctest_compatibility.h"
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||||
|
|
||||||
#define private public
|
#define private public
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
using nlohmann::json;
|
using nlohmann::json;
|
||||||
#undef private
|
#undef private
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
// shortcut to scan a string literal
|
// shortcut to scan a string literal
|
||||||
|
|||||||
@ -29,11 +29,16 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "doctest_compatibility.h"
|
#include "doctest_compatibility.h"
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||||
|
|
||||||
#define private public
|
#define private public
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
using nlohmann::json;
|
using nlohmann::json;
|
||||||
#undef private
|
#undef private
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
#include <valarray>
|
#include <valarray>
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
|
|||||||
@ -30,11 +30,16 @@ SOFTWARE.
|
|||||||
#include "doctest_compatibility.h"
|
#include "doctest_compatibility.h"
|
||||||
DOCTEST_GCC_SUPPRESS_WARNING("-Wfloat-equal")
|
DOCTEST_GCC_SUPPRESS_WARNING("-Wfloat-equal")
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||||
|
|
||||||
#define private public
|
#define private public
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
using nlohmann::json;
|
using nlohmann::json;
|
||||||
#undef private
|
#undef private
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <forward_list>
|
#include <forward_list>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|||||||
@ -29,11 +29,16 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "doctest_compatibility.h"
|
#include "doctest_compatibility.h"
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||||
|
|
||||||
#define private public
|
#define private public
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
using nlohmann::json;
|
using nlohmann::json;
|
||||||
#undef private
|
#undef private
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
|
|||||||
@ -29,11 +29,16 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "doctest_compatibility.h"
|
#include "doctest_compatibility.h"
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||||
|
|
||||||
#define private public
|
#define private public
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
using nlohmann::json;
|
using nlohmann::json;
|
||||||
#undef private
|
#undef private
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <forward_list>
|
#include <forward_list>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|||||||
@ -29,11 +29,16 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "doctest_compatibility.h"
|
#include "doctest_compatibility.h"
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||||
|
|
||||||
#define private public
|
#define private public
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
using nlohmann::json;
|
using nlohmann::json;
|
||||||
#undef private
|
#undef private
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
TEST_CASE("iterators 1")
|
TEST_CASE("iterators 1")
|
||||||
{
|
{
|
||||||
SECTION("basic behavior")
|
SECTION("basic behavior")
|
||||||
|
|||||||
@ -29,11 +29,16 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "doctest_compatibility.h"
|
#include "doctest_compatibility.h"
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||||
|
|
||||||
#define private public
|
#define private public
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
using nlohmann::json;
|
using nlohmann::json;
|
||||||
#undef private
|
#undef private
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
TEST_CASE("JSON pointers")
|
TEST_CASE("JSON pointers")
|
||||||
{
|
{
|
||||||
SECTION("errors")
|
SECTION("errors")
|
||||||
|
|||||||
@ -42,12 +42,17 @@ enum test
|
|||||||
struct pod {};
|
struct pod {};
|
||||||
struct pod_bis {};
|
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) noexcept{}
|
||||||
void to_json(json&, pod_bis){}
|
void to_json(json&, pod_bis){}
|
||||||
void from_json(const json&, pod) noexcept{}
|
void from_json(const json&, pod) noexcept{}
|
||||||
void from_json(const json&, pod_bis){}
|
void from_json(const json&, pod_bis){}
|
||||||
static json j;
|
static json j;
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
static_assert(noexcept(json{}), "");
|
static_assert(noexcept(json{}), "");
|
||||||
static_assert(noexcept(nlohmann::to_json(j, 2)), "");
|
static_assert(noexcept(nlohmann::to_json(j, 2)), "");
|
||||||
static_assert(noexcept(nlohmann::to_json(j, 2.5)), "");
|
static_assert(noexcept(nlohmann::to_json(j, 2.5)), "");
|
||||||
|
|||||||
@ -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...
|
// for some reason including this after the json header leads to linker errors with VS 2017...
|
||||||
#include <locale>
|
#include <locale>
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||||
|
|
||||||
#define private public
|
#define private public
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
using nlohmann::json;
|
using nlohmann::json;
|
||||||
#undef private
|
#undef private
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|||||||
@ -32,11 +32,16 @@ SOFTWARE.
|
|||||||
// for some reason including this after the json header leads to linker errors with VS 2017...
|
// for some reason including this after the json header leads to linker errors with VS 2017...
|
||||||
#include <locale>
|
#include <locale>
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||||
|
|
||||||
#define private public
|
#define private public
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
using nlohmann::json;
|
using nlohmann::json;
|
||||||
#undef private
|
#undef private
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user