From afb613e9e7b737648ac8ea0d3138d0d498c95553 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Wed, 11 Jan 2023 21:53:30 -0700 Subject: [PATCH] Remove a workaround for libstdc++4.8 Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D141564 --- llvm/include/llvm/Support/JSON.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/llvm/include/llvm/Support/JSON.h b/llvm/include/llvm/Support/JSON.h index 9a50253..d350891 100644 --- a/llvm/include/llvm/Support/JSON.h +++ b/llvm/include/llvm/Support/JSON.h @@ -193,10 +193,9 @@ public: void push_back(Value &&E); template void emplace_back(Args &&...A); void pop_back(); - // FIXME: insert() takes const_iterator since C++11, old libstdc++ disagrees. - iterator insert(iterator P, const Value &E); - iterator insert(iterator P, Value &&E); - template iterator insert(iterator P, It A, It Z); + iterator insert(const_iterator P, const Value &E); + iterator insert(const_iterator P, Value &&E); + template iterator insert(const_iterator P, It A, It Z); template iterator emplace(const_iterator P, Args &&...A); friend bool operator==(const Array &L, const Array &R); @@ -535,14 +534,14 @@ template inline void Array::emplace_back(Args &&...A) { V.emplace_back(std::forward(A)...); } inline void Array::pop_back() { V.pop_back(); } -inline typename Array::iterator Array::insert(iterator P, const Value &E) { +inline typename Array::iterator Array::insert(const_iterator P, const Value &E) { return V.insert(P, E); } -inline typename Array::iterator Array::insert(iterator P, Value &&E) { +inline typename Array::iterator Array::insert(const_iterator P, Value &&E) { return V.insert(P, std::move(E)); } template -inline typename Array::iterator Array::insert(iterator P, It A, It Z) { +inline typename Array::iterator Array::insert(const_iterator P, It A, It Z) { return V.insert(P, A, Z); } template -- 2.7.4