flattests_cpp17 doesn't compile with Visual Studio 2017: warning C4100: 'indent': unreferenced formal parameter (#6811)

stringify_util.h(127): error C2220: warning treated as error - no 'object' file generated
stringify_util.h(127): warning C4100: 'indent': unreferenced formal parameter
stringify_util.h(85): warning C4100: 'indent': unreferenced formal parameter
stringify_util.h(85): warning C4100: 'fbs': unreferenced formal parameter
This commit is contained in:
Stefan F 2021-08-31 00:32:36 +02:00 committed by GitHub
parent e3c76a5cde
commit ae145293cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -83,6 +83,8 @@ std::string StringifyTableOrStructImpl(const FBS &fbs,
template<typename FBS>
std::string StringifyTableOrStruct(const FBS &fbs, const std::string &indent) {
(void)fbs;
(void)indent;
static constexpr size_t field_count = FBS::Traits::fields_number;
std::string out;
if constexpr (field_count > 0) {
@ -125,6 +127,7 @@ template<typename T> std::string StringifyArithmeticType(T val) {
template<typename T>
std::optional<std::string> StringifyFlatbufferValue(T &&val,
const std::string &indent) {
(void)indent;
constexpr bool is_pointer = std::is_pointer_v<std::remove_reference_t<T>>;
if constexpr (is_pointer) {
if (val == nullptr) return std::nullopt; // Field is absent.