Index: include/llvm/ADT/ArrayRef.h =================================================================== --- include/llvm/ADT/ArrayRef.h +++ include/llvm/ADT/ArrayRef.h @@ -45,6 +45,7 @@ using const_iterator = const T *; using size_type = size_t; using reverse_iterator = std::reverse_iterator; + using value_type = typename std::remove_cv::type; private: /// The start of the array, in an external buffer. Index: unittests/ADT/ArrayRefTest.cpp =================================================================== --- unittests/ADT/ArrayRefTest.cpp +++ unittests/ADT/ArrayRefTest.cpp @@ -52,6 +52,14 @@ "Assigning from an initializer list"); #endif +// Check Typedefs. +static_assert( + std::is_same::value_type, int>::value, + "erroneous value_type"); +static_assert( + std::is_same::value_type, int>::value, + "erroneous value_type"); + namespace { TEST(ArrayRefTest, AllocatorCopy) {