From c39c808c014719f905bd9080a13f7824268bb485 Mon Sep 17 00:00:00 2001 From: Christopher Dykes Date: Tue, 1 Nov 2016 11:23:40 -0700 Subject: [PATCH] Silence a couple of warnings for MSVC in Optional.h Summary: Silence a couple of warnings that get very spammy for MSVC. Reviewed By: yfeldblum Differential Revision: D4098682 fbshipit-source-id: b410b56062cdf82367675ea9c3dd22975e7b91bd --- folly/Optional.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/folly/Optional.h b/folly/Optional.h index f00a40e1..ed601ee7 100644 --- a/folly/Optional.h +++ b/folly/Optional.h @@ -59,6 +59,8 @@ #include #include +#include + namespace folly { namespace detail { struct NoneHelper {}; } @@ -292,10 +294,16 @@ class Optional { }; }; + FOLLY_PUSH_WARNING + // These are both informational warnings, but they trigger rare enough + // that we've left them enabled. + FOLLY_MSVC_DISABLE_WARNING(4587) // constructor of .value is not called + FOLLY_MSVC_DISABLE_WARNING(4588) // destructor of .value is not called StorageNonTriviallyDestructible() : hasValue{false} {} ~StorageNonTriviallyDestructible() { clear(); } + FOLLY_POP_WARNING void clear() { if (hasValue) { -- 2.34.1