diff --git a/llvm/include/llvm/ADT/Statistic.h b/llvm/include/llvm/ADT/Statistic.h
index 6c195cc44990..9475b6697031 100644
--- a/llvm/include/llvm/ADT/Statistic.h
+++ b/llvm/include/llvm/ADT/Statistic.h
@@ -200,7 +200,7 @@ void PrintStatisticsJSON(raw_ostream &OS);
 /// during it's execution. It will return the value at the point that it is
 /// read. However, it will prevent new statistics from registering until it
 /// completes.
-const std::vector<std::pair<StringRef, uint64_t>> GetStatistics();
+std::vector<std::pair<StringRef, uint64_t>> GetStatistics();
 
 /// Reset the statistics. This can be used to zero and de-register the
 /// statistics in order to measure a compilation.
diff --git a/llvm/lib/Support/Statistic.cpp b/llvm/lib/Support/Statistic.cpp
index ec12118650c1..df9f7c5e0be3 100644
--- a/llvm/lib/Support/Statistic.cpp
+++ b/llvm/lib/Support/Statistic.cpp
@@ -253,7 +253,7 @@ void llvm::PrintStatistics() {
 #endif
 }
 
-const std::vector<std::pair<StringRef, uint64_t>> llvm::GetStatistics() {
+std::vector<std::pair<StringRef, uint64_t>> llvm::GetStatistics() {
   sys::SmartScopedLock<true> Reader(*StatLock);
   std::vector<std::pair<StringRef, uint64_t>> ReturnStats;
 
diff --git a/llvm/unittests/ADT/StatisticTest.cpp b/llvm/unittests/ADT/StatisticTest.cpp
index 523f510cccdd..470d20340e66 100644
--- a/llvm/unittests/ADT/StatisticTest.cpp
+++ b/llvm/unittests/ADT/StatisticTest.cpp
@@ -128,7 +128,7 @@ TEST(StatisticTest, API) {
   // It should empty the list and zero the counters.
   ResetStatistics();
   {
-    auto &Range = GetStatistics();
+    auto Range = GetStatistics();
     EXPECT_EQ(Range.begin(), Range.end());
     EXPECT_EQ(Counter, 0u);
     EXPECT_EQ(Counter2, 0u);
@@ -144,7 +144,7 @@ TEST(StatisticTest, API) {
   Counter2++;
 
   {
-    auto &Range = GetStatistics();
+    auto Range = GetStatistics();
     EXPECT_EQ(Range.begin() + 2, Range.end());
     EXPECT_EQ(Counter, 1u);
     EXPECT_EQ(Counter2, 1u);