Skip to content

Commit

Permalink
[ADT] Enable ArrayRef/StringRef is_assignable tests on MSVC
Browse files Browse the repository at this point in the history
Now that we've dropped VS2015 support (D64326) we can enable these static_asserts on MSVC builds as VS2017+ correctly handles them

llvm-svn: 365471
  • Loading branch information
RKSimon committed Jul 9, 2019
1 parent 4bc20fa commit e995ce5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
5 changes: 0 additions & 5 deletions llvm/unittests/ADT/ArrayRefTest.cpp
Expand Up @@ -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");
Expand All @@ -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 {

Expand Down
6 changes: 0 additions & 6 deletions llvm/unittests/ADT/StringRefTest.cpp
Expand Up @@ -34,10 +34,6 @@ std::ostream &operator<<(std::ostream &OS,
// 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");
Expand All @@ -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) {
Expand Down

0 comments on commit e995ce5

Please sign in to comment.