[libcxx-commits] [PATCH] D150885: [libc++] Fix issue with std::map::find in Objective-C++ with modules

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu May 18 13:46:39 PDT 2023


ldionne updated this revision to Diff 523541.
ldionne added a comment.

Fix GCC CI


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150885/new/

https://reviews.llvm.org/D150885

Files:
  libcxx/include/module.modulemap.in
  libcxx/test/libcxx/containers/associative/map/find.modules.compile.pass.mm


Index: libcxx/test/libcxx/containers/associative/map/find.modules.compile.pass.mm
===================================================================
--- /dev/null
+++ libcxx/test/libcxx/containers/associative/map/find.modules.compile.pass.mm
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// Make sure that we don't get a compiler error when trying to use std::map::find
+// from Objective-C++. This happened in Objective-C++ mode with modules enabled (rdar://106813461).
+
+// REQUIRES: objective-c++
+
+#include <map>
+
+void f(std::map<int, int> const& map, int key) {
+    (void)map.find(key);
+}
Index: libcxx/include/module.modulemap.in
===================================================================
--- libcxx/include/module.modulemap.in
+++ libcxx/include/module.modulemap.in
@@ -847,18 +847,6 @@
       module condition_variable { private header "__condition_variable/condition_variable.h" }
     }
   }
-  module coroutine {
-    header "coroutine"
-    export compare
-    export *
-
-    module __coroutine {
-      module coroutine_handle           { private header "__coroutine/coroutine_handle.h" }
-      module coroutine_traits           { private header "__coroutine/coroutine_traits.h" }
-      module noop_coroutine_handle      { private header "__coroutine/noop_coroutine_handle.h" }
-      module trivial_awaitables         { private header "__coroutine/trivial_awaitables.h" }
-    }
-  }
   module deque {
     header "deque"
     export initializer_list
@@ -1799,6 +1787,19 @@
   module __undef_macros      {         header "__undef_macros"      export * }
   module __verbose_abort     {         header "__verbose_abort"     export * }
 
+  module coroutine {
+    header "coroutine"
+    export compare
+    export *
+
+    module __coroutine {
+      module coroutine_handle           { private header "__coroutine/coroutine_handle.h" }
+      module coroutine_traits           { private header "__coroutine/coroutine_traits.h" }
+      module noop_coroutine_handle      { private header "__coroutine/noop_coroutine_handle.h" }
+      module trivial_awaitables         { private header "__coroutine/trivial_awaitables.h" }
+    }
+  }
+
   module experimental {
     requires cplusplus11
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150885.523541.patch
Type: text/x-patch
Size: 2573 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230518/61efd29b/attachment-0001.bin>


More information about the libcxx-commits mailing list