From eea2d35d3a5c46ac2b825b90bdc67ef10f1df425 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@musicpd.org>
Date: Fri, 19 Nov 2021 16:04:25 +0100
Subject: [PATCH] util/AllocatedString, ...: add missing include for
 std::exchange()

Fixes building with GCC 12.
---
 NEWS                         | 1 +
 src/input/InputStream.hxx    | 1 +
 src/lib/curl/Slist.hxx       | 2 +-
 src/lib/yajl/Handle.hxx      | 2 +-
 src/util/AllocatedArray.hxx  | 1 +
 src/util/AllocatedString.hxx | 1 +
 6 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index ab21d0157..7d378490b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,5 @@
 ver 0.23.5 (not yet released)
+* GCC 12 build fixes
 
 ver 0.23.4 (2021/11/11)
 * protocol
diff --git a/src/input/InputStream.hxx b/src/input/InputStream.hxx
index 63c0e908f..857e06da7 100644
--- a/src/input/InputStream.hxx
+++ b/src/input/InputStream.hxx
@@ -27,6 +27,7 @@
 #include <cassert>
 #include <memory>
 #include <string>
+#include <utility>
 
 struct Tag;
 class InputStreamHandler;
diff --git a/src/lib/curl/Slist.hxx b/src/lib/curl/Slist.hxx
index b53580a21..304c34052 100644
--- a/src/lib/curl/Slist.hxx
+++ b/src/lib/curl/Slist.hxx
@@ -32,8 +32,8 @@
 
 #include <curl/curl.h>
 
-#include <algorithm>
 #include <stdexcept>
+#include <utility>
 
 /**
  * OO wrapper for "struct curl_slist *".
diff --git a/src/lib/yajl/Handle.hxx b/src/lib/yajl/Handle.hxx
index a19c59e50..6b87883ba 100644
--- a/src/lib/yajl/Handle.hxx
+++ b/src/lib/yajl/Handle.hxx
@@ -32,7 +32,7 @@
 
 #include <yajl/yajl_parse.h>
 
-#include <algorithm>
+#include <utility>
 
 namespace Yajl {
 
diff --git a/src/util/AllocatedArray.hxx b/src/util/AllocatedArray.hxx
index b85614fad..476997f00 100644
--- a/src/util/AllocatedArray.hxx
+++ b/src/util/AllocatedArray.hxx
@@ -35,6 +35,7 @@
 
 #include <algorithm>
 #include <cassert>
+#include <utility>
 
 /**
  * An array allocated on the heap with a length determined at runtime.
diff --git a/src/util/AllocatedString.hxx b/src/util/AllocatedString.hxx
index 330335c3e..d16710856 100644
--- a/src/util/AllocatedString.hxx
+++ b/src/util/AllocatedString.hxx
@@ -35,6 +35,7 @@
 #include <algorithm>
 #include <cstddef>
 #include <string_view>
+#include <utility>
 
 /**
  * A string pointer whose memory is managed by this class.