SmallVector: Declare explicit instantiations.
authorThomas Köppe <tkoeppe@google.com>
Mon, 28 Nov 2022 15:08:54 +0000 (16:08 +0100)
committerBenjamin Kramer <benny.kra@googlemail.com>
Mon, 28 Nov 2022 15:10:35 +0000 (16:10 +0100)
This was an ODR violation

llvm/include/llvm/ADT/SmallVector.h

index bbc5bc8..98dce89 100644 (file)
@@ -1312,6 +1312,12 @@ template <typename Out, typename R> SmallVector<Out> to_vector_of(R &&Range) {
   return {std::begin(Range), std::end(Range)};
 }
 
+// Explicit instantiations
+extern template class llvm::SmallVectorBase<uint32_t>;
+#if SIZE_MAX > UINT32_MAX
+extern template class llvm::SmallVectorBase<uint64_t>;
+#endif
+
 } // end namespace llvm
 
 namespace std {