Commit e6e7080e authored by Igor Sugak's avatar Igor Sugak Committed by Facebook GitHub Bot

fix a couple of -Wunused-value violations

Summary:
Reported by clang-12:
```
folly/test/SynchronizedTestLib-inl.h:587:7: error: expression result unused [-Werror,-Wunused-value]
      SYNCHRONIZED_DUAL(lv, v, lm, m) {
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
folly/Synchronized.h:1819:5: note: expanded from macro 'SYNCHRONIZED_DUAL'
    ::folly::detail::SYNCHRONIZED_macro_is_deprecated{};                       \
    ^                                                ~~
```

Reviewed By: chadaustin

Differential Revision: D27954777

fbshipit-source-id: bd1dba5ebf563b34b496457b980568ea1c978442
parent 5d1b9736
...@@ -1781,7 +1781,7 @@ struct [[deprecated( ...@@ -1781,7 +1781,7 @@ struct [[deprecated(
FOLLY_MSVC_DISABLE_WARNING(4459) /* declaration hides global */ \ FOLLY_MSVC_DISABLE_WARNING(4459) /* declaration hides global */ \
FOLLY_GCC_DISABLE_NEW_SHADOW_WARNINGS \ FOLLY_GCC_DISABLE_NEW_SHADOW_WARNINGS \
if (bool SYNCHRONIZED_VAR(state) = false) { \ if (bool SYNCHRONIZED_VAR(state) = false) { \
::folly::detail::SYNCHRONIZED_macro_is_deprecated{}; \ (void)::folly::detail::SYNCHRONIZED_macro_is_deprecated{}; \
} else \ } else \
for (auto SYNCHRONIZED_VAR(lockedPtr) = \ for (auto SYNCHRONIZED_VAR(lockedPtr) = \
(FB_VA_GLUE(FB_ARG_2_OR_1, (__VA_ARGS__))).contextualLock(); \ (FB_VA_GLUE(FB_ARG_2_OR_1, (__VA_ARGS__))).contextualLock(); \
...@@ -1816,7 +1816,7 @@ struct [[deprecated( ...@@ -1816,7 +1816,7 @@ struct [[deprecated(
*/ */
#define SYNCHRONIZED_DUAL(n1, e1, n2, e2) \ #define SYNCHRONIZED_DUAL(n1, e1, n2, e2) \
if (bool SYNCHRONIZED_VAR(state) = false) { \ if (bool SYNCHRONIZED_VAR(state) = false) { \
::folly::detail::SYNCHRONIZED_macro_is_deprecated{}; \ (void)::folly::detail::SYNCHRONIZED_macro_is_deprecated{}; \
} else \ } else \
for (auto SYNCHRONIZED_VAR(ptrs) = acquireLockedPair(e1, e2); \ for (auto SYNCHRONIZED_VAR(ptrs) = acquireLockedPair(e1, e2); \
!SYNCHRONIZED_VAR(state); \ !SYNCHRONIZED_VAR(state); \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment