diff --git a/clang/include/clang/Basic/Module.h b/clang/include/clang/Basic/Module.h index 3d035f0a5f787..69a1de6f79b35 100644 --- a/clang/include/clang/Basic/Module.h +++ b/clang/include/clang/Basic/Module.h @@ -64,6 +64,11 @@ struct ASTFileSignature : std::array { explicit operator bool() const { return *this != BaseT({{0}}); } + // Support implicit cast to ArrayRef. Note that ASTFileSignature::size + // prevents implicit cast to ArrayRef because one of the implicit constructors + // of ArrayRef requires access to BaseT::size. + operator ArrayRef() const { return ArrayRef(data(), size); } + /// Returns the value truncated to the size of an uint64_t. uint64_t truncatedValue() const { uint64_t Value = 0; diff --git a/llvm/include/llvm/ADT/ArrayRef.h b/llvm/include/llvm/ADT/ArrayRef.h index 892482d64e4a1..268510b803ea0 100644 --- a/llvm/include/llvm/ADT/ArrayRef.h +++ b/llvm/include/llvm/ADT/ArrayRef.h @@ -98,11 +98,6 @@ namespace llvm { /*implicit*/ constexpr ArrayRef(const C &V) : Data(V.data()), Length(V.size()) {} - /// Construct an ArrayRef from a std::array - template - /*implicit*/ constexpr ArrayRef(const std::array &Arr) - : Data(Arr.data()), Length(N) {} - /// Construct an ArrayRef from a C array. template /*implicit*/ constexpr ArrayRef(const T (&Arr LLVM_LIFETIME_BOUND)[N])