1
0
mirror of https://github.com/nlohmann/json.git synced 2026-07-29 07:03:02 +04:00

🎨 use Clang-Format

This commit is contained in:
Niels Lohmann
2023-11-29 15:02:51 +01:00
parent 9cca280a4d
commit 311ad0b877
123 changed files with 17740 additions and 15765 deletions
+12 -9
View File
@@ -16,12 +16,15 @@ DOCTEST_GCC_SUPPRESS_WARNING("-Wnoexcept")
using nlohmann::json;
namespace
namespace {
enum test
{
enum test {};
};
struct pod {};
struct pod_bis {};
struct pod
{};
struct pod_bis
{};
void to_json(json& /*unused*/, pod /*unused*/) noexcept;
void to_json(json& /*unused*/, pod_bis /*unused*/);
@@ -45,15 +48,15 @@ static_assert(noexcept(json(pod{})), "");
static_assert(noexcept(std::declval<json>().get<pod>()), "");
static_assert(!noexcept(std::declval<json>().get<pod_bis>()), "");
static_assert(noexcept(json(pod{})), "");
} // namespace
} // namespace
TEST_CASE("noexcept")
{
// silence -Wunneeded-internal-declaration errors
static_cast<void>(static_cast<void(*)(json&, pod)>(&to_json));
static_cast<void>(static_cast<void(*)(json&, pod_bis)>(&to_json));
static_cast<void>(static_cast<void(*)(const json&, pod)>(&from_json));
static_cast<void>(static_cast<void(*)(const json&, pod_bis)>(&from_json));
static_cast<void>(static_cast<void (*)(json&, pod)>(&to_json));
static_cast<void>(static_cast<void (*)(json&, pod_bis)>(&to_json));
static_cast<void>(static_cast<void (*)(const json&, pod)>(&from_json));
static_cast<void>(static_cast<void (*)(const json&, pod_bis)>(&from_json));
SECTION("nothrow-copy-constructible exceptions")
{