[libc++] Granularize algorithm includes

Reviewed By: Mordante, ldionne, Quuxplusone, #libc, #libc_abi

Spies: #libc_vendors, libcxx-commits, miyuki

Differential Revision: https://reviews.llvm.org/D119667

GitOrigin-RevId: 2e2f3158c604adb8401a2a44a03f58d4b6f1c7f9
diff --git a/src/demangle/Utility.h b/src/demangle/Utility.h
index 97272ae..4ec821c 100644
--- a/src/demangle/Utility.h
+++ b/src/demangle/Utility.h
@@ -17,6 +17,7 @@
 #define DEMANGLE_UTILITY_H
 
 #include "StringView.h"
+#include <algorithm>
 #include <array>
 #include <cstdint>
 #include <cstdlib>
diff --git a/test/test_demangle.pass.cpp b/test/test_demangle.pass.cpp
index 5371f4b..cc9e4ac 100644
--- a/test/test_demangle.pass.cpp
+++ b/test/test_demangle.pass.cpp
@@ -15,6 +15,7 @@
 // UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx11.0
 
 #include "support/timer.h"
+#include <algorithm>
 #include <cassert>
 #include <cstdio>
 #include <cstdlib>