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

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Dec 9 08:13:08 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

<details>
<summary>Changes</summary>

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

---
Full diff: https://github.com/llvm/llvm-project/pull/119227.diff


1 Files Affected:

- (modified) libcxx/include/flat_map (+7-2) 


``````````diff
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

``````````

</details>


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


More information about the libcxx-commits mailing list