[llvm] afb613e - Remove a workaround for libstdc++4.8
Owen Anderson via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 12 19:16:48 PST 2023
Author: Owen Anderson
Date: 2023-01-12T20:16:42-07:00
New Revision: afb613e9e7b737648ac8ea0d3138d0d498c95553
URL: https://github.com/llvm/llvm-project/commit/afb613e9e7b737648ac8ea0d3138d0d498c95553
DIFF: https://github.com/llvm/llvm-project/commit/afb613e9e7b737648ac8ea0d3138d0d498c95553.diff
LOG: Remove a workaround for libstdc++4.8
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D141564
Added:
Modified:
llvm/include/llvm/Support/JSON.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/Support/JSON.h b/llvm/include/llvm/Support/JSON.h
index 9a5025360b9f..d35089122941 100644
--- a/llvm/include/llvm/Support/JSON.h
+++ b/llvm/include/llvm/Support/JSON.h
@@ -193,10 +193,9 @@ class Array {
void push_back(Value &&E);
template <typename... Args> 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 <typename It> iterator insert(iterator P, It A, It Z);
+ iterator insert(const_iterator P, const Value &E);
+ iterator insert(const_iterator P, Value &&E);
+ template <typename It> iterator insert(const_iterator P, It A, It Z);
template <typename... Args> iterator emplace(const_iterator P, Args &&...A);
friend bool operator==(const Array &L, const Array &R);
@@ -535,14 +534,14 @@ template <typename... Args> inline void Array::emplace_back(Args &&...A) {
V.emplace_back(std::forward<Args>(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 <typename It>
-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 <typename... Args>
More information about the llvm-commits
mailing list