[llvm] r365471 - [ADT] Enable ArrayRef/StringRef is_assignable tests on MSVC

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 9 05:20:04 PDT 2019


Author: rksimon
Date: Tue Jul  9 05:20:04 2019
New Revision: 365471

URL: http://llvm.org/viewvc/llvm-project?rev=365471&view=rev
Log:
[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

Modified:
    llvm/trunk/unittests/ADT/ArrayRefTest.cpp
    llvm/trunk/unittests/ADT/StringRefTest.cpp

Modified: llvm/trunk/unittests/ADT/ArrayRefTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/ArrayRefTest.cpp?rev=365471&r1=365470&r2=365471&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/ArrayRefTest.cpp (original)
+++ llvm/trunk/unittests/ADT/ArrayRefTest.cpp Tue Jul  9 05:20:04 2019
@@ -33,10 +33,6 @@ static_assert(
 
 // Check that we can't accidentally assign a temporary location to an ArrayRef.
 // (Unfortunately we can't make use of the same thing with constructors.)
-//
-// Disable this check under MSVC; even MSVC 2015 isn't inconsistent between
-// std::is_assignable and actually writing such an assignment.
-#if !defined(_MSC_VER)
 static_assert(
     !std::is_assignable<ArrayRef<int *>&, int *>::value,
     "Assigning from single prvalue element");
@@ -49,7 +45,6 @@ static_assert(
 static_assert(
     !std::is_assignable<ArrayRef<int *>&, std::initializer_list<int *>>::value,
     "Assigning from an initializer list");
-#endif
 
 namespace {
 

Modified: llvm/trunk/unittests/ADT/StringRefTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/StringRefTest.cpp?rev=365471&r1=365470&r2=365471&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/StringRefTest.cpp (original)
+++ llvm/trunk/unittests/ADT/StringRefTest.cpp Tue Jul  9 05:20:04 2019
@@ -34,10 +34,6 @@ std::ostream &operator<<(std::ostream &O
 // Check that we can't accidentally assign a temporary std::string to a
 // StringRef. (Unfortunately we can't make use of the same thing with
 // constructors.)
-//
-// Disable this check under MSVC; even MSVC 2015 isn't consistent between
-// std::is_assignable and actually writing such an assignment.
-#if !defined(_MSC_VER)
 static_assert(
     !std::is_assignable<StringRef&, std::string>::value,
     "Assigning from prvalue std::string");
@@ -56,8 +52,6 @@ static_assert(
 static_assert(
     std::is_assignable<StringRef&, const char * &>::value,
     "Assigning from lvalue C string");
-#endif
-
 
 namespace {
 TEST(StringRefTest, Construction) {




More information about the llvm-commits mailing list