[libcxx-commits] [libcxx] [libc++] Properly guard flat_map includes based on C++ version (PR #119227)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Dec 9 08:12:31 PST 2024


https://github.com/ldionne created https://github.com/llvm/llvm-project/pull/119227

That's what we (try to) do consistently for all other umbrella headers.

>From 34d44448287bdd6462e60089607ae51178fc96c7 Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Mon, 9 Dec 2024 10:45:11 -0500
Subject: [PATCH] [libc++] Properly guard flat_map includes based on C++
 version

That's what we (try to) do consistently for all other umbrella headers.
---
 libcxx/include/flat_map | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/libcxx/include/flat_map b/libcxx/include/flat_map
index 15d79dd1ddca34..870dd2e26a2379 100644
--- a/libcxx/include/flat_map
+++ b/libcxx/include/flat_map
@@ -39,8 +39,13 @@ namespace std {
 
 #include <__assert> // all public C++ headers provide the assertion handler
 #include <__config>
-#include <__flat_map/flat_map.h>
-#include <__flat_map/sorted_unique.h>
+
+#if _LIBCPP_STD_VER >= 23
+#  include <__flat_map/flat_map.h>
+#  include <__flat_map/sorted_unique.h>
+#endif
+
+// for feature-test macros
 #include <version>
 
 // standard required includes



More information about the libcxx-commits mailing list