Skip to content

Commit

Permalink
Fix bogus warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinH committed Sep 22, 2023
1 parent fcacea2 commit 1c6a319
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/tao/pegtl/internal/has_current_position.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1c6a319

Please sign in to comment.