Skip to content

Commit

Permalink
Avoid warnings on MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
cfis committed Nov 19, 2024
1 parent 6d2f231 commit 914adef
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rice/stl/variant.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,15 @@ namespace Rice::detail

VALUE result = Qnil;

#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-value"
#endif
((std::holds_alternative<std::tuple_element_t<I, Tuple_T>>(data) ?
(result = convertElement<std::tuple_element_t<I, Tuple_T>>(data, takeOwnership), true) : false) || ...);
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif

return result;
}
Expand Down Expand Up @@ -96,11 +100,15 @@ namespace Rice::detail
// See comments above for explanation of this code
VALUE result = Qnil;

#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-value"
#endif
((std::holds_alternative<std::tuple_element_t<I, Tuple_T>>(data) ?
(result = convertElement<std::tuple_element_t<I, Tuple_T>>(data, takeOwnership), true) : false) || ...);
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif

return result;
}
Expand Down

0 comments on commit 914adef

Please sign in to comment.