Commit d2e50930 authored by Jim Meyering's avatar Jim Meyering Committed by Facebook Github Bot

folly/Synchronized.h: avoid shadowing warnings

Summary:
Nested uses of SYNCHRONIZED (and related) macros leads
inevitably to shadowed variable declarations.
There is already a use of FOLLY_GCC_DISABLE_WARNING(shadow)
to disable -Wshadow in that code, but obviously, that cannot
help with the new options, so do similar for them via
the new FOLLY_GCC_DISABLE_NEW_SHADOW_WARNINGS.

Depends on D4041696

Reviewed By: markisaa

Differential Revision: D4041728

fbshipit-source-id: b85fb3452f6855d359f9b910abbd02cf8433f3f7
parent 9047707e
...@@ -1302,6 +1302,7 @@ void swap(Synchronized<T, M>& lhs, Synchronized<T, M>& rhs) { ...@@ -1302,6 +1302,7 @@ void swap(Synchronized<T, M>& lhs, Synchronized<T, M>& rhs) {
#define SYNCHRONIZED(...) \ #define SYNCHRONIZED(...) \
FOLLY_PUSH_WARNING \ FOLLY_PUSH_WARNING \
FOLLY_GCC_DISABLE_WARNING(shadow) \ FOLLY_GCC_DISABLE_WARNING(shadow) \
FOLLY_GCC_DISABLE_NEW_SHADOW_WARNINGS \
if (bool SYNCHRONIZED_state = false) { \ if (bool SYNCHRONIZED_state = false) { \
} else \ } else \
for (auto SYNCHRONIZED_lockedPtr = \ for (auto SYNCHRONIZED_lockedPtr = \
......
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