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.