2
0
mirror of https://github.com/boostorg/spirit.git synced 2026-01-19 04:42:11 +00:00

V2: Fix Clang 14 -Wbitwise-instead-of-logical

This commit is contained in:
Nikita Kniazev
2022-09-13 20:37:35 +03:00
parent 1fd010384e
commit b003bb4f64
2 changed files with 6 additions and 3 deletions

View File

@@ -51,7 +51,8 @@ namespace boost { namespace spirit
typename result_of::attribute_value<First1, First2, Last2, Pred>::type
attribute = spirit::detail::attribute_value<Pred, First1, Last2>(first2);
return (0 != (f(*first1, attribute) |
// cast bool to int to avoid -Wbitwise-instead-of-logical warning
return (0 != (static_cast<int>(f(*first1, attribute)) |
detail::any_if_ns<Pred>(
fusion::next(first1)
, attribute_next<Pred, First1, Last2>(first2)

View File

@@ -38,7 +38,8 @@ namespace boost { namespace spirit
inline bool
any_ns(First1 const& first1, First2 const& first2, Last const& last, F& f, mpl::false_)
{
return (0 != (f(*first1, *first2) |
// cast bool to int to avoid -Wbitwise-instead-of-logical warning
return (0 != (static_cast<int>(f(*first1, *first2)) |
detail::any_ns(
fusion::next(first1)
, fusion::next(first2)
@@ -59,7 +60,8 @@ namespace boost { namespace spirit
inline bool
any_ns(First const& first, Last const& last, F& f, mpl::false_)
{
return (0 != (f(*first) |
// cast bool to int to avoid -Wbitwise-instead-of-logical warning
return (0 != (static_cast<int>(f(*first)) |
detail::any_ns(
fusion::next(first)
, last