Commit d129ad43 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Cut various sites supporting MSVC <= 2015

Summary: [Folly] Cut various sites supporting MSVC <= 2015, which is insufficiently compatible.

Reviewed By: Orvid

Differential Revision: D13747631

fbshipit-source-id: 3d63d3a57258b5695b1236a81f3ddfe2f4af9cb4
parent 4a0367d4
......@@ -101,15 +101,8 @@ namespace expected_detail {
template <typename Value, typename Error>
struct PromiseReturn;
#ifdef _MSC_VER
// MSVC 2015 can't handle the StrictConjunction, so we have
// to use std::conjunction instead.
template <template <class...> class Trait, class... Ts>
using StrictAllOf = std::conjunction<Trait<Ts>...>;
#else
template <template <class...> class Trait, class... Ts>
using StrictAllOf = StrictConjunction<Trait<Ts>...>;
#endif
template <class T>
using IsCopyable = StrictConjunction<
......@@ -244,11 +237,6 @@ 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_;
}
......@@ -258,7 +246,6 @@ struct ExpectedStorage {
Error&& error() && {
return std::move(error_);
}
FOLLY_POP_WARNING
};
template <class Value, class Error>
......@@ -545,11 +532,6 @@ struct ExpectedStorage<Value, Error, StorageType::ePODStruct> {
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_;
}
......@@ -559,7 +541,6 @@ struct ExpectedStorage<Value, Error, StorageType::ePODStruct> {
Error&& error() && {
return std::move(error_);
}
FOLLY_POP_WARNING
};
namespace expected_detail_ExpectedHelper {
......
......@@ -1248,18 +1248,15 @@ class basic_fbstring {
// otherwise MSVC 2017 will aggressively pre-resolve value_type to
// traits_type::char_type, which won't compare as equal when determining
// which overload the implementation is referring to.
// Also note that MSVC 2015 Update 3 requires us to explicitly specify the
// namespace in-which to search for basic_fbstring, otherwise it tries to
// look for basic_fbstring::basic_fbstring, which is just plain wrong.
template <typename TP>
typename std::enable_if<
std::is_convertible<
TP,
typename folly::basic_fbstring<E, T, A, Storage>::value_type>::
typename basic_fbstring<E, T, A, Storage>::value_type>::
value &&
!std::is_same<
typename std::decay<TP>::type,
typename folly::basic_fbstring<E, T, A, Storage>::value_type>::
typename basic_fbstring<E, T, A, Storage>::value_type>::
value,
basic_fbstring<E, T, A, Storage>&>::type
operator=(TP c) = delete;
......
......@@ -72,7 +72,7 @@ template <int BITS>
const poly_table<BITS> FingerprintTable<BITS>::table = {};
#ifndef _MSC_VER
// MSVC 2015 can't handle these extern specialization declarations,
// MSVC as of 2017 can't handle these extern specialization declarations,
// but they aren't needed for things to work right, so we just don't
// declare them in the header for MSVC.
......
......@@ -412,17 +412,10 @@ class Optional {
};
bool hasValue;
FOLLY_PUSH_WARNING
// These are both informational warnings, but they trigger rare
// enough that we've left them enabled. Needed as long as MSVC
// 2015 is supported.
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) {
......
......@@ -462,7 +462,7 @@ constexpr auto kCpplibVer = 0;
// extern int const num;
// FOLLY_STORAGE_CONSTEXPR int const num = 3;
//
// True for MSVC 2015 and MSVC 2017.
// True as of MSVC 2017.
#if _MSC_VER
#define FOLLY_STORAGE_CONSTEXPR
#define FOLLY_STORAGE_CPP14_CONSTEXPR
......
......@@ -419,15 +419,15 @@ struct IsLessThanComparable
namespace traits_detail_IsNothrowSwappable {
#if defined(__cpp_lib_is_swappable) || (_CPPLIB_VER && _HAS_CXX17)
// MSVC 2015+ already implements the C++17 P0185R1 proposal which
// adds std::is_nothrow_swappable, so use it instead if C++17 mode
// is enabled.
// MSVC already implements the C++17 P0185R1 proposal which adds
// std::is_nothrow_swappable, so use it instead if C++17 mode is
// enabled.
template <typename T>
using IsNothrowSwappable = std::is_nothrow_swappable<T>;
#elif _CPPLIB_VER
// MSVC 2015+ defines the base even if C++17 is disabled, and
// MSVC 2015 has issues with our fallback implementation due to
// over-eager evaluation of noexcept.
// MSVC defines the base even if C++17 is disabled, and MSVC has
// issues with our fallback implementation due to over-eager
// evaluation of noexcept.
template <typename T>
using IsNothrowSwappable = std::_Is_nothrow_swappable<T>;
#else
......
......@@ -27,14 +27,7 @@ struct __cxa_eh_globals;
// declared in cxxabi.h from libstdc++-v3
extern "C" __cxa_eh_globals* __cxa_get_globals() noexcept;
} // namespace __cxxabiv1
#elif defined(_MSC_VER) && (_MSC_VER >= 1400) && \
(_MSC_VER < 1900) // MSVC++ 8.0 or greater
#define FOLLY_EXCEPTION_COUNT_USE_GETPTD
// forward declaration (originally defined in mtdll.h from MSVCRT)
struct _tiddata;
extern "C" _tiddata* _getptd(); // declared in mtdll.h from MSVCRT
#elif defined(FOLLY_FORCE_EXCEPTION_COUNT_USE_STD) || \
(defined(_MSC_VER) && (_MSC_VER >= 1900)) // MSVC++ 2015
#elif defined(FOLLY_FORCE_EXCEPTION_COUNT_USE_STD) || defined(_MSC_VER)
#define FOLLY_EXCEPTION_COUNT_USE_STD
#else
// Raise an error when trying to use this on unsupported platforms.
......
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