From aa142694c08158b173dff009d3075e605bc97e3c Mon Sep 17 00:00:00 2001 From: Ruoyu Zhong Date: Tue, 28 Oct 2025 13:08:28 +0800 Subject: Fix missing includes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was missed in 4b22a1e36 (apt-team/apt!522), and caused the following error when built with GCC 12: /var/tmp/apt-20251026-9687-pc954n/apt-3.1.10/apt-private/private-cmndline.cc:544:23: error: ‘optional’ is not a member of ‘std’ 544 | static std::pair, std::optional> parseCliVersion(std::string_view version) | ^~~~~~~~ /var/tmp/apt-20251026-9687-pc954n/apt-3.1.10/apt-private/private-cmndline.cc:27:8: note: ‘std::optional’ is defined in header ‘’; did you forget to ‘#include ’? 26 | #include +++ |+#include 27 | /*}}}*/ While at it, also add missing include for std::pair. Discovered in https://github.com/Homebrew/homebrew-core/pull/251162 by Anton Melnikov. Co-authored-by: Anton Melnikov Signed-off-by: Ruoyu Zhong --- apt-private/private-cmndline.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index 7ea18782c..c26a3f7f4 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -21,6 +21,8 @@ #include #include +#include +#include #include #include -- cgit v1.2.3-70-g09d2