X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=blobdiff_plain;f=folly%2FExpected.h;h=2b791c117810d73f6772e18645c90de2287d7546;hp=ee765cc92a154fcac6f9f8fe77202b6cd203c025;hb=b5e4bc034ee27308714f9fd7b3f1a6d5c75ac2bf;hpb=bfdfe5e42dcc01a346ce157530101df6d50df234 diff --git a/folly/Expected.h b/folly/Expected.h index ee765cc9..2b791c11 100644 --- a/folly/Expected.h +++ b/folly/Expected.h @@ -233,6 +233,11 @@ struct ExpectedStorage { Value&& value() && { return std::move(value_); } + // TODO (t17322426): remove when VS2015 support is deprecated + // VS2015 static analyzer incorrectly flags these as unreachable in certain + // circumstances. VS2017 does not have this problem on the same code. + FOLLY_PUSH_WARNING + FOLLY_MSVC_DISABLE_WARNING(4702) // unreachable code Error& error() & { return error_; } @@ -242,6 +247,7 @@ struct ExpectedStorage { Error&& error() && { return std::move(error_); } + FOLLY_POP_WARNING }; template @@ -527,6 +533,11 @@ struct ExpectedStorage { Value&& value() && { return std::move(value_); } + // TODO (t17322426): remove when VS2015 support is deprecated + // VS2015 static analyzer incorrectly flags these as unreachable in certain + // circumstances. VS2017 does not have this problem on the same code. + FOLLY_PUSH_WARNING + FOLLY_MSVC_DISABLE_WARNING(4702) // unreachable code Error& error() & { return error_; } @@ -536,6 +547,7 @@ struct ExpectedStorage { Error&& error() && { return std::move(error_); } + FOLLY_POP_WARNING }; namespace expected_detail_ExpectedHelper {