From: Christopher Dykes Date: Tue, 1 Nov 2016 18:23:40 +0000 (-0700) Subject: Silence a couple of warnings for MSVC in Optional.h X-Git-Tag: v2016.11.07.00~20 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c39c808c014719f905bd9080a13f7824268bb485;p=folly.git 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 --- 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) {