diff --git a/llvm/include/llvm/ADT/ArrayRef.h b/llvm/include/llvm/ADT/ArrayRef.h index 84c083cb1e666..716e2b0e3bcf3 100644 --- a/llvm/include/llvm/ADT/ArrayRef.h +++ b/llvm/include/llvm/ADT/ArrayRef.h @@ -327,7 +327,6 @@ namespace llvm { template >, std::is_convertible< decltype(std::declval().data()) *, T *const *>, std::is_integral().size())>>, diff --git a/llvm/unittests/ADT/ArrayRefTest.cpp b/llvm/unittests/ADT/ArrayRefTest.cpp index 23677589d5367..3254fb1291e00 100644 --- a/llvm/unittests/ADT/ArrayRefTest.cpp +++ b/llvm/unittests/ADT/ArrayRefTest.cpp @@ -491,6 +491,10 @@ static_assert( static_assert( std::is_constructible_v, std::span>, "should be able to construct MutableArrayRef from mutable std::span"); +static_assert( + std::is_constructible_v, const std::span>, + "should be able to construct MutableArrayRef from const std::span with " + "mutable elements"); #endif } // end anonymous namespace