From cd60045014554e02a749555214e774d79c8d9a38 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Mon, 10 May 2021 21:51:51 +0900 Subject: [PATCH] fix: gcc 7 introduces wshadow variants --- toml/types.hpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/toml/types.hpp b/toml/types.hpp index caf718b..a292d09 100644 --- a/toml/types.hpp +++ b/toml/types.hpp @@ -41,8 +41,12 @@ using floating = double; // "float" is a keyward, cannot use it here. // to avoid warnings about `value_t::integer` is "shadowing" toml::integer in // GCC -Wshadow=global. #if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wshadow=global" +# pragma GCC diagnostic push +# if 7 <= __GNUC__ +# pragma GCC diagnostic ignored "-Wshadow=global" +# else // gcc-6 or older +# pragma GCC diagnostic ignored "-Wshadow" +# endif #endif enum class value_t : std::uint8_t { @@ -59,7 +63,7 @@ enum class value_t : std::uint8_t table = 10, }; #if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic pop +# pragma GCC diagnostic pop #endif template