Skip to content

Commit e6e7080

Browse files
Igor Sugakfacebook-github-bot
authored andcommitted
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
1 parent 5d1b973 commit e6e7080

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

folly/Synchronized.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,7 +1781,7 @@ struct [[deprecated(
17811781
FOLLY_MSVC_DISABLE_WARNING(4459) /* declaration hides global */ \
17821782
FOLLY_GCC_DISABLE_NEW_SHADOW_WARNINGS \
17831783
if (bool SYNCHRONIZED_VAR(state) = false) { \
1784-
::folly::detail::SYNCHRONIZED_macro_is_deprecated{}; \
1784+
(void)::folly::detail::SYNCHRONIZED_macro_is_deprecated{}; \
17851785
} else \
17861786
for (auto SYNCHRONIZED_VAR(lockedPtr) = \
17871787
(FB_VA_GLUE(FB_ARG_2_OR_1, (__VA_ARGS__))).contextualLock(); \
@@ -1816,7 +1816,7 @@ struct [[deprecated(
18161816
*/
18171817
#define SYNCHRONIZED_DUAL(n1, e1, n2, e2) \
18181818
if (bool SYNCHRONIZED_VAR(state) = false) { \
1819-
::folly::detail::SYNCHRONIZED_macro_is_deprecated{}; \
1819+
(void)::folly::detail::SYNCHRONIZED_macro_is_deprecated{}; \
18201820
} else \
18211821
for (auto SYNCHRONIZED_VAR(ptrs) = acquireLockedPair(e1, e2); \
18221822
!SYNCHRONIZED_VAR(state); \

0 commit comments

Comments
 (0)