[PATCH] D141564: Remove a workaround for libstdc++4.8
Owen Anderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 11 20:53:42 PST 2023
resistor created this revision.
Herald added a project: All.
resistor requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D141564
Files:
llvm/include/llvm/Support/JSON.h
Index: llvm/include/llvm/Support/JSON.h
===================================================================
--- llvm/include/llvm/Support/JSON.h
+++ llvm/include/llvm/Support/JSON.h
@@ -193,10 +193,9 @@
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 @@
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>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141564.488468.patch
Type: text/x-patch
Size: 1607 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230112/2b02bf49/attachment.bin>
More information about the llvm-commits
mailing list