fixes for latest MSVC
also: - minor doc tweaks
This commit is contained in:
parent
4824a10031
commit
698ee0ecd1
@ -31,7 +31,6 @@ AttributeMacros:
|
|||||||
- TOML_EMPTY_BASES
|
- TOML_EMPTY_BASES
|
||||||
- TOML_EXPORTED_CLASS
|
- TOML_EXPORTED_CLASS
|
||||||
- TOML_FLAGS_ENUM
|
- TOML_FLAGS_ENUM
|
||||||
- TOML_LIKELY_CASE
|
|
||||||
- TOML_OPEN_ENUM
|
- TOML_OPEN_ENUM
|
||||||
- TOML_OPEN_FLAGS_ENUM
|
- TOML_OPEN_FLAGS_ENUM
|
||||||
- TOML_TRIVIAL_ABI
|
- TOML_TRIVIAL_ABI
|
||||||
@ -175,6 +174,7 @@ StatementMacros:
|
|||||||
- TOML_EXTERN
|
- TOML_EXTERN
|
||||||
- TOML_EXTERNAL_LINKAGE
|
- TOML_EXTERNAL_LINKAGE
|
||||||
- TOML_INTERNAL_LINKAGE
|
- TOML_INTERNAL_LINKAGE
|
||||||
|
- TOML_LIKELY_CASE
|
||||||
- TOML_MEMBER_ATTR
|
- TOML_MEMBER_ATTR
|
||||||
- TOML_NEVER_INLINE
|
- TOML_NEVER_INLINE
|
||||||
- TOML_NODISCARD
|
- TOML_NODISCARD
|
||||||
|
@ -18,7 +18,8 @@ extra_files = [
|
|||||||
'images/badge-TOML.svg',
|
'images/badge-TOML.svg',
|
||||||
'images/badge-gitter.svg'
|
'images/badge-gitter.svg'
|
||||||
]
|
]
|
||||||
html_header = '<style>#poxy-main-banner, .poxy-main-banner { padding: 2rem; }</style>'
|
html_header = '<style>#poxy-main-banner { padding: 2rem; }</style>'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[warnings]
|
[warnings]
|
||||||
@ -55,7 +56,6 @@ paths = [ 'images' ]
|
|||||||
|
|
||||||
[code_blocks]
|
[code_blocks]
|
||||||
macros = [ 'TOML_[A-Z0-9_]+?', 'print_value' ]
|
macros = [ 'TOML_[A-Z0-9_]+?', 'print_value' ]
|
||||||
string_literals = [ '_toml' ]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -464,6 +464,7 @@
|
|||||||
__pragma(warning(disable : 4061)) \
|
__pragma(warning(disable : 4061)) \
|
||||||
__pragma(warning(disable : 4062)) \
|
__pragma(warning(disable : 4062)) \
|
||||||
__pragma(warning(disable : 4063)) \
|
__pragma(warning(disable : 4063)) \
|
||||||
|
__pragma(warning(disable : 5262)) /* switch-case implicit fallthrough (false-positive) */ \
|
||||||
__pragma(warning(disable : 26819)) /* cg: unannotated fallthrough */ \
|
__pragma(warning(disable : 26819)) /* cg: unannotated fallthrough */ \
|
||||||
static_assert(true)
|
static_assert(true)
|
||||||
|
|
||||||
@ -475,9 +476,9 @@
|
|||||||
__pragma(warning(disable : 4505)) /* unreferenced local function removed */ \
|
__pragma(warning(disable : 4505)) /* unreferenced local function removed */ \
|
||||||
__pragma(warning(disable : 4514)) /* unreferenced inline function has been removed */ \
|
__pragma(warning(disable : 4514)) /* unreferenced inline function has been removed */ \
|
||||||
__pragma(warning(disable : 4582)) /* constructor is not implicitly called */ \
|
__pragma(warning(disable : 4582)) /* constructor is not implicitly called */ \
|
||||||
__pragma(warning(disable : 4623)) /* default constructor was implicitly defined as deleted */ \
|
__pragma(warning(disable : 4623)) /* default constructor was implicitly defined as deleted */ \
|
||||||
__pragma(warning(disable : 4625)) /* copy constructor was implicitly defined as deleted */ \
|
__pragma(warning(disable : 4625)) /* copy constructor was implicitly defined as deleted */ \
|
||||||
__pragma(warning(disable : 4626)) /* assignment operator was implicitly defined as deleted */ \
|
__pragma(warning(disable : 4626)) /* assignment operator was implicitly defined as deleted */ \
|
||||||
__pragma(warning(disable : 4710)) /* function not inlined */ \
|
__pragma(warning(disable : 4710)) /* function not inlined */ \
|
||||||
__pragma(warning(disable : 4711)) /* function selected for automatic expansion */ \
|
__pragma(warning(disable : 4711)) /* function selected for automatic expansion */ \
|
||||||
__pragma(warning(disable : 4820)) /* N bytes padding added */ \
|
__pragma(warning(disable : 4820)) /* N bytes padding added */ \
|
||||||
@ -486,6 +487,7 @@
|
|||||||
__pragma(warning(disable : 5027)) /* move assignment operator was implicitly defined as deleted */ \
|
__pragma(warning(disable : 5027)) /* move assignment operator was implicitly defined as deleted */ \
|
||||||
__pragma(warning(disable : 5039)) /* potentially throwing function passed to 'extern "C"' function */ \
|
__pragma(warning(disable : 5039)) /* potentially throwing function passed to 'extern "C"' function */ \
|
||||||
__pragma(warning(disable : 5045)) /* Compiler will insert Spectre mitigation */ \
|
__pragma(warning(disable : 5045)) /* Compiler will insert Spectre mitigation */ \
|
||||||
|
__pragma(warning(disable : 5264)) /* const variable is not used (false-positive) */ \
|
||||||
__pragma(warning(disable : 26451)) \
|
__pragma(warning(disable : 26451)) \
|
||||||
__pragma(warning(disable : 26490)) \
|
__pragma(warning(disable : 26490)) \
|
||||||
__pragma(warning(disable : 26495)) \
|
__pragma(warning(disable : 26495)) \
|
||||||
@ -508,6 +510,7 @@
|
|||||||
__pragma(warning(disable : 4348)) \
|
__pragma(warning(disable : 4348)) \
|
||||||
__pragma(warning(disable : 4668)) \
|
__pragma(warning(disable : 4668)) \
|
||||||
__pragma(warning(disable : 5105)) \
|
__pragma(warning(disable : 5105)) \
|
||||||
|
__pragma(warning(disable : 5264)) \
|
||||||
TOML_DISABLE_CODE_ANALYSIS_WARNINGS; \
|
TOML_DISABLE_CODE_ANALYSIS_WARNINGS; \
|
||||||
TOML_DISABLE_SWITCH_WARNINGS; \
|
TOML_DISABLE_SWITCH_WARNINGS; \
|
||||||
TOML_DISABLE_SPAM_WARNINGS; \
|
TOML_DISABLE_SPAM_WARNINGS; \
|
||||||
|
@ -106,46 +106,46 @@ TEST_CASE("formatters")
|
|||||||
const auto data_date = toml::date{ 2021, 11, 2 };
|
const auto data_date = toml::date{ 2021, 11, 2 };
|
||||||
const auto data_time = toml::time{ 20, 33, 0 };
|
const auto data_time = toml::time{ 20, 33, 0 };
|
||||||
const auto data = toml::table{
|
const auto data = toml::table{
|
||||||
{ "integers"sv,
|
{ "integers"sv,
|
||||||
toml::table{ { "zero"sv, 0 },
|
toml::table{ { "zero"sv, 0 },
|
||||||
{ "one"sv, 1 },
|
{ "one"sv, 1 },
|
||||||
{ "dec"sv, 10 },
|
{ "dec"sv, 10 },
|
||||||
{ "bin"sv, 10, toml::value_flags::format_as_binary },
|
{ "bin"sv, 10, toml::value_flags::format_as_binary },
|
||||||
{ "oct"sv, 10, toml::value_flags::format_as_octal },
|
{ "oct"sv, 10, toml::value_flags::format_as_octal },
|
||||||
{ "hex"sv, 10, toml::value_flags::format_as_hexadecimal } } },
|
{ "hex"sv, 10, toml::value_flags::format_as_hexadecimal } } },
|
||||||
{ "floats"sv,
|
{ "floats"sv,
|
||||||
toml::table{ { "pos_zero"sv, +0.0 },
|
toml::table{ { "pos_zero"sv, +0.0 },
|
||||||
{ "neg_zero"sv, -0.0 },
|
{ "neg_zero"sv, -0.0 },
|
||||||
{ "one"sv, 1.0 },
|
{ "one"sv, 1.0 },
|
||||||
{ "pos_inf"sv, +std::numeric_limits<double>::infinity() },
|
{ "pos_inf"sv, +std::numeric_limits<double>::infinity() },
|
||||||
{ "neg_inf"sv, -std::numeric_limits<double>::infinity() },
|
{ "neg_inf"sv, -std::numeric_limits<double>::infinity() },
|
||||||
{ "pos_nan"sv, +std::numeric_limits<double>::quiet_NaN() },
|
{ "pos_nan"sv, +std::numeric_limits<double>::quiet_NaN() },
|
||||||
{ "neg_nan"sv, -std::numeric_limits<double>::quiet_NaN() }
|
{ "neg_nan"sv, -std::numeric_limits<double>::quiet_NaN() }
|
||||||
|
|
||||||
} },
|
} },
|
||||||
|
|
||||||
{ "dates and times"sv,
|
{ "dates and times"sv,
|
||||||
toml::table{
|
toml::table{
|
||||||
|
|
||||||
{ "dates"sv, toml::table{ { "val"sv, data_date } } },
|
{ "dates"sv, toml::table{ { "val"sv, data_date } } },
|
||||||
|
|
||||||
{ "times"sv, toml::table{ { "val"sv, data_time } } },
|
{ "times"sv, toml::table{ { "val"sv, data_time } } },
|
||||||
|
|
||||||
{ "date-times"sv,
|
{ "date-times"sv,
|
||||||
toml::table{
|
toml::table{
|
||||||
|
|
||||||
{ "local"sv, toml::table{ { "val"sv, toml::date_time{ data_date, data_time } } } },
|
{ "local"sv, toml::table{ { "val"sv, toml::date_time{ data_date, data_time } } } },
|
||||||
{ "offset"sv,
|
{ "offset"sv,
|
||||||
toml::table{
|
toml::table{
|
||||||
{ "val"sv, toml::date_time{ data_date, data_time, toml::time_offset{} } } } } } } } },
|
{ "val"sv, toml::date_time{ data_date, data_time, toml::time_offset{} } } } } } } } },
|
||||||
|
|
||||||
{ "bools"sv,
|
{ "bools"sv,
|
||||||
toml::table{ { "true"sv, true }, //
|
toml::table{ { "true"sv, true }, //
|
||||||
{ "false"sv, false } } },
|
{ "false"sv, false } } },
|
||||||
|
|
||||||
{
|
{
|
||||||
"strings"sv,
|
"strings"sv,
|
||||||
toml::array{ R"()"sv,
|
toml::array{ R"()"sv,
|
||||||
R"(string)"sv,
|
R"(string)"sv,
|
||||||
R"(string with a single quote in it: ')"sv,
|
R"(string with a single quote in it: ')"sv,
|
||||||
R"(string with a double quote in it: ")"sv,
|
R"(string with a double quote in it: ")"sv,
|
||||||
@ -153,9 +153,9 @@ TEST_CASE("formatters")
|
|||||||
R"(a long string to force the array over multiple lines)"sv },
|
R"(a long string to force the array over multiple lines)"sv },
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "a"sv,
|
{ "a"sv,
|
||||||
toml::table{ { "val", true },
|
toml::table{ { "val", true },
|
||||||
{ "b"sv, toml::table{ { "val", true }, { "c"sv, toml::table{ { "val", true } } } } } } }
|
{ "b"sv, toml::table{ { "val", true }, { "c"sv, toml::table{ { "val", true } } } } } } }
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
#pragma warning(disable : 4365)
|
#pragma warning(disable : 4365)
|
||||||
#pragma warning(disable : 4868)
|
#pragma warning(disable : 4868)
|
||||||
#pragma warning(disable : 5105)
|
#pragma warning(disable : 5105)
|
||||||
|
#pragma warning(disable : 5262)
|
||||||
|
#pragma warning(disable : 5264)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(USE_VENDORED_LIBS) || USE_VENDORED_LIBS
|
#if !defined(USE_VENDORED_LIBS) || USE_VENDORED_LIBS
|
||||||
|
@ -3,6 +3,11 @@
|
|||||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(disable : 5262)
|
||||||
|
#pragma warning(disable : 5264)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CATCH_CONFIG_RUNNER
|
#define CATCH_CONFIG_RUNNER
|
||||||
#include "lib_catch2.h"
|
#include "lib_catch2.h"
|
||||||
#include <clocale>
|
#include <clocale>
|
||||||
|
9
toml.hpp
9
toml.hpp
@ -494,6 +494,7 @@
|
|||||||
__pragma(warning(disable : 4061)) \
|
__pragma(warning(disable : 4061)) \
|
||||||
__pragma(warning(disable : 4062)) \
|
__pragma(warning(disable : 4062)) \
|
||||||
__pragma(warning(disable : 4063)) \
|
__pragma(warning(disable : 4063)) \
|
||||||
|
__pragma(warning(disable : 5262)) /* switch-case implicit fallthrough (false-positive) */ \
|
||||||
__pragma(warning(disable : 26819)) /* cg: unannotated fallthrough */ \
|
__pragma(warning(disable : 26819)) /* cg: unannotated fallthrough */ \
|
||||||
static_assert(true)
|
static_assert(true)
|
||||||
|
|
||||||
@ -505,9 +506,9 @@
|
|||||||
__pragma(warning(disable : 4505)) /* unreferenced local function removed */ \
|
__pragma(warning(disable : 4505)) /* unreferenced local function removed */ \
|
||||||
__pragma(warning(disable : 4514)) /* unreferenced inline function has been removed */ \
|
__pragma(warning(disable : 4514)) /* unreferenced inline function has been removed */ \
|
||||||
__pragma(warning(disable : 4582)) /* constructor is not implicitly called */ \
|
__pragma(warning(disable : 4582)) /* constructor is not implicitly called */ \
|
||||||
__pragma(warning(disable : 4623)) /* default constructor was implicitly defined as deleted */ \
|
__pragma(warning(disable : 4623)) /* default constructor was implicitly defined as deleted */ \
|
||||||
__pragma(warning(disable : 4625)) /* copy constructor was implicitly defined as deleted */ \
|
__pragma(warning(disable : 4625)) /* copy constructor was implicitly defined as deleted */ \
|
||||||
__pragma(warning(disable : 4626)) /* assignment operator was implicitly defined as deleted */ \
|
__pragma(warning(disable : 4626)) /* assignment operator was implicitly defined as deleted */ \
|
||||||
__pragma(warning(disable : 4710)) /* function not inlined */ \
|
__pragma(warning(disable : 4710)) /* function not inlined */ \
|
||||||
__pragma(warning(disable : 4711)) /* function selected for automatic expansion */ \
|
__pragma(warning(disable : 4711)) /* function selected for automatic expansion */ \
|
||||||
__pragma(warning(disable : 4820)) /* N bytes padding added */ \
|
__pragma(warning(disable : 4820)) /* N bytes padding added */ \
|
||||||
@ -516,6 +517,7 @@
|
|||||||
__pragma(warning(disable : 5027)) /* move assignment operator was implicitly defined as deleted */ \
|
__pragma(warning(disable : 5027)) /* move assignment operator was implicitly defined as deleted */ \
|
||||||
__pragma(warning(disable : 5039)) /* potentially throwing function passed to 'extern "C"' function */ \
|
__pragma(warning(disable : 5039)) /* potentially throwing function passed to 'extern "C"' function */ \
|
||||||
__pragma(warning(disable : 5045)) /* Compiler will insert Spectre mitigation */ \
|
__pragma(warning(disable : 5045)) /* Compiler will insert Spectre mitigation */ \
|
||||||
|
__pragma(warning(disable : 5264)) /* const variable is not used (false-positive) */ \
|
||||||
__pragma(warning(disable : 26451)) \
|
__pragma(warning(disable : 26451)) \
|
||||||
__pragma(warning(disable : 26490)) \
|
__pragma(warning(disable : 26490)) \
|
||||||
__pragma(warning(disable : 26495)) \
|
__pragma(warning(disable : 26495)) \
|
||||||
@ -538,6 +540,7 @@
|
|||||||
__pragma(warning(disable : 4348)) \
|
__pragma(warning(disable : 4348)) \
|
||||||
__pragma(warning(disable : 4668)) \
|
__pragma(warning(disable : 4668)) \
|
||||||
__pragma(warning(disable : 5105)) \
|
__pragma(warning(disable : 5105)) \
|
||||||
|
__pragma(warning(disable : 5264)) \
|
||||||
TOML_DISABLE_CODE_ANALYSIS_WARNINGS; \
|
TOML_DISABLE_CODE_ANALYSIS_WARNINGS; \
|
||||||
TOML_DISABLE_SWITCH_WARNINGS; \
|
TOML_DISABLE_SWITCH_WARNINGS; \
|
||||||
TOML_DISABLE_SPAM_WARNINGS; \
|
TOML_DISABLE_SPAM_WARNINGS; \
|
||||||
|
Loading…
Reference in New Issue
Block a user