Fixed clang build

This commit is contained in:
James Moore 2020-01-11 12:40:03 +00:00
parent 658e613902
commit ed104d547f
13 changed files with 65 additions and 0 deletions

View File

@ -29,11 +29,16 @@ SOFTWARE.
#include "doctest_compatibility.h"
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wkeyword-macro"
#define private public
#include <nlohmann/json.hpp>
using nlohmann::json;
#undef private
#pragma clang diagnostic pop
namespace
{
// special test case to check if memory is leaked if constructor throws

View File

@ -29,11 +29,16 @@ SOFTWARE.
#include "doctest_compatibility.h"
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wkeyword-macro"
#define private public
#include <nlohmann/json.hpp>
using nlohmann::json;
#undef private
#pragma clang diagnostic pop
TEST_CASE("const_iterator class")
{
SECTION("construction")

View File

@ -29,11 +29,16 @@ SOFTWARE.
#include "doctest_compatibility.h"
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wkeyword-macro"
#define private public
#include <nlohmann/json.hpp>
using nlohmann::json;
#undef private
#pragma clang diagnostic pop
TEST_CASE("iterator class")
{
SECTION("construction")

View File

@ -29,11 +29,16 @@ SOFTWARE.
#include "doctest_compatibility.h"
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wkeyword-macro"
#define private public
#include <nlohmann/json.hpp>
using nlohmann::json;
#undef private
#pragma clang diagnostic pop
namespace
{
// shortcut to scan a string literal

View File

@ -29,11 +29,16 @@ SOFTWARE.
#include "doctest_compatibility.h"
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wkeyword-macro"
#define private public
#include <nlohmann/json.hpp>
using nlohmann::json;
#undef private
#pragma clang diagnostic pop
#include <valarray>
namespace

View File

@ -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 <nlohmann/json.hpp>
using nlohmann::json;
#undef private
#pragma clang diagnostic pop
#include <deque>
#include <forward_list>
#include <fstream>

View File

@ -29,11 +29,16 @@ SOFTWARE.
#include "doctest_compatibility.h"
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wkeyword-macro"
#define private public
#include <nlohmann/json.hpp>
using nlohmann::json;
#undef private
#pragma clang diagnostic pop
#include <sstream>
namespace

View File

@ -29,11 +29,16 @@ SOFTWARE.
#include "doctest_compatibility.h"
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wkeyword-macro"
#define private public
#include <nlohmann/json.hpp>
using nlohmann::json;
#undef private
#pragma clang diagnostic pop
#include <deque>
#include <forward_list>
#include <list>

View File

@ -29,11 +29,16 @@ SOFTWARE.
#include "doctest_compatibility.h"
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wkeyword-macro"
#define private public
#include <nlohmann/json.hpp>
using nlohmann::json;
#undef private
#pragma clang diagnostic pop
TEST_CASE("iterators 1")
{
SECTION("basic behavior")

View File

@ -29,11 +29,16 @@ SOFTWARE.
#include "doctest_compatibility.h"
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wkeyword-macro"
#define private public
#include <nlohmann/json.hpp>
using nlohmann::json;
#undef private
#pragma clang diagnostic pop
TEST_CASE("JSON pointers")
{
SECTION("errors")

View File

@ -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)), "");

View File

@ -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 <locale>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wkeyword-macro"
#define private public
#include <nlohmann/json.hpp>
using nlohmann::json;
#undef private
#pragma clang diagnostic pop
#include <fstream>
#include <sstream>
#include <list>

View File

@ -32,11 +32,16 @@ SOFTWARE.
// for some reason including this after the json header leads to linker errors with VS 2017...
#include <locale>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wkeyword-macro"
#define private public
#include <nlohmann/json.hpp>
using nlohmann::json;
#undef private
#pragma clang diagnostic pop
#include <fstream>
#include <sstream>
#include <iostream>