llvm.org GIT mirror llvm / 23edf4c
[ADT] Enable ArrayRef/StringRef is_assignable tests on MSVC Now that we've dropped VS2015 support (D64326) we can enable these static_asserts on MSVC builds as VS2017+ correctly handles them git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365471 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Pilgrim a month ago
2 changed file(s) with 0 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
3232
3333 // Check that we can't accidentally assign a temporary location to an ArrayRef.
3434 // (Unfortunately we can't make use of the same thing with constructors.)
35 //
36 // Disable this check under MSVC; even MSVC 2015 isn't inconsistent between
37 // std::is_assignable and actually writing such an assignment.
38 #if !defined(_MSC_VER)
3935 static_assert(
4036 !std::is_assignable&, int *>::value,
4137 "Assigning from single prvalue element");
4844 static_assert(
4945 !std::is_assignable&, std::initializer_list>::value,
5046 "Assigning from an initializer list");
51 #endif
5247
5348 namespace {
5449
3333 // Check that we can't accidentally assign a temporary std::string to a
3434 // StringRef. (Unfortunately we can't make use of the same thing with
3535 // constructors.)
36 //
37 // Disable this check under MSVC; even MSVC 2015 isn't consistent between
38 // std::is_assignable and actually writing such an assignment.
39 #if !defined(_MSC_VER)
4036 static_assert(
4137 !std::is_assignable::value,
4238 "Assigning from prvalue std::string");
5551 static_assert(
5652 std::is_assignable::value,
5753 "Assigning from lvalue C string");
58 #endif
59
6054
6155 namespace {
6256 TEST(StringRefTest, Construction) {