[libcxx-commits] [libcxx] [libc++][modules] Adds std.compat module. (PR #71438)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 21 09:57:53 PST 2023


================
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+
+// UNSUPPORTED: libcpp-has-no-std-modules
+// UNSUPPORTED: clang-modules-build
+
+// A minimal test to validate import works.
+
+import std.compat;
+
+int main(int, char**) {
+  ::printf("Hello modular world");
----------------
ldionne wrote:

Here let's use something like this, which is more freestanding friendly:

```
return ::strlen("Hello modular world") == whatever;
```

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


More information about the libcxx-commits mailing list