[libcxx-commits] [PATCH] D151467: [libc++][NFC] Add additional test case for modules issue in Objective-C++

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu May 25 09:46:43 PDT 2023


ldionne created this revision.
Herald added a project: All.
ldionne requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151467

Files:
  libcxx/test/libcxx/containers/sequences/vector/erase.modules.compile.pass.mm


Index: libcxx/test/libcxx/containers/sequences/vector/erase.modules.compile.pass.mm
===================================================================
--- /dev/null
+++ libcxx/test/libcxx/containers/sequences/vector/erase.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::vector::erase
+// from Objective-C++. This happened in Objective-C++ mode with modules enabled (rdar://106813461).
+
+// REQUIRES: objective-c++
+
+#include <vector>
+
+void f(std::vector<int> vec, std::vector<int>::iterator it) {
+    (void)vec.erase(it);
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151467.525670.patch
Type: text/x-patch
Size: 975 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230525/6baf57e2/attachment-0001.bin>


More information about the libcxx-commits mailing list