Skip to content

Commit

Permalink
fatal/container/flag_set.h: avoid a newly-exposed -Wint-in-bool-conte…
Browse files Browse the repository at this point in the history
…xt warning

Summary:
This avoids the following errors:

  fatal/container/flag_set.h:80:26: error: converting the result of '<<' to a boolean; did you mean '(fatal::flag_set<>::flags_type(1) << try_index_of<tag_list, x<0> >::value) != 0'? [-Werror,-Wint-in-bool-context]
  fatal/container/flag_set.h:80:26: error: converting the result of '<<' to a boolean; did you mean '(fatal::flag_set<>::flags_type(1) << try_index_of<tag_list, x<1> >::value) != 0'? [-Werror,-Wint-in-bool-context]
  fatal/container/flag_set.h:80:26: error: converting the result of '<<' to a boolean; did you mean '(fatal::flag_set<>::flags_type(1) << try_index_of<tag_list, x<2> >::value) != 0'? [-Werror,-Wint-in-bool-context]
  fatal/container/flag_set.h:80:26: error: converting the result of '<<' to a boolean; did you mean '(fatal::flag_set<>::flags_type(1) << try_index_of<tag_list, x<3> >::value) != 0'? [-Werror,-Wint-in-bool-context]
  fatal/container/flag_set.h:80:26: error: converting the result of '<<' to a boolean; did you mean '(fatal::flag_set<>::flags_type(1) << try_index_of<tag_list, x<4> >::value) != 0'? [-Werror,-Wint-in-bool-context]
  fatal/container/flag_set.h:80:26: error: converting the result of '<<' to a boolean; did you mean '(fatal::flag_set<>::flags_type(1) << try_index_of<tag_list, x<5> >::value) != 0'? [-Werror,-Wint-in-bool-context]
  fatal/container/flag_set.h:80:26: error: converting the result of '<<' to a boolean; did you mean '(fatal::flag_set<fatal::x<0> >::flags_type(1) << try_index_of<tag_list, x<0> >::value) != 0'? [-Werror,-Wint-in-bool-context]
  fatal/container/flag_set.h:80:26: error: converting the result of '<<' to a boolean; did you mean '(fatal::flag_set<fatal::x<1> >::flags_type(1) << try_index_of<tag_list, x<1> >::value) != 0'? [-Werror,-Wint-in-bool-context]

Reviewed By: igorsugak

Differential Revision: D33337831

fbshipit-source-id: ce9304c960abbafe348c61d47fbb265ae9c2d2d7
  • Loading branch information
meyering authored and facebook-github-bot committed Jan 4, 2022
1 parent 9011336 commit d955f1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fatal/container/flag_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct flag_set {
flags_type
>::type,
(try_index_of<tag_list, UFlags>::value < size<tag_list>::value
? (flags_type(1) << try_index_of<tag_list, UFlags>::value)
? ((flags_type(1) << try_index_of<tag_list, UFlags>::value) != 0)
: 0
)
>...
Expand Down

0 comments on commit d955f1e

Please sign in to comment.