diff --git a/include/tao/pegtl/internal/has_current_position.hpp b/include/tao/pegtl/internal/has_current_position.hpp index 3558ceb14..d1ef5e44c 100644 --- a/include/tao/pegtl/internal/has_current_position.hpp +++ b/include/tao/pegtl/internal/has_current_position.hpp @@ -15,7 +15,9 @@ namespace TAO_PEGTL_NAMESPACE::internal inline constexpr bool has_current_position = false; template< typename C > - inline constexpr bool has_current_position< C, decltype( std::declval< C >().current_position(), void() ) > = true; + inline constexpr bool has_current_position< C, decltype( (void)std::declval< C >().current_position(), void() ) > = true; + + // The (void) is to shut up a warning from GCC 9 and 10 about the return value of the nodiscard-function current_position() being ignored. } // namespace TAO_PEGTL_NAMESPACE::internal