[clang] 84be785 - [NFC] [C++] [Modules] Mark P1811 as implemented and add test (#146993)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 7 18:54:36 PDT 2025


Author: Ashwin Kishin Banwari
Date: 2025-07-08T09:54:33+08:00
New Revision: 84be78524de7d06943570854cbf31537c8f45199

URL: https://github.com/llvm/llvm-project/commit/84be78524de7d06943570854cbf31537c8f45199
DIFF: https://github.com/llvm/llvm-project/commit/84be78524de7d06943570854cbf31537c8f45199.diff

LOG: [NFC] [C++] [Modules] Mark P1811 as implemented and add test (#146993)

This is already implemented. See godbolt:
https://godbolt.org/z/7x3arqj3G

Added: 
    clang/test/SemaCXX/P1811.cpp

Modified: 
    clang/www/cxx_status.html

Removed: 
    


################################################################################
diff  --git a/clang/test/SemaCXX/P1811.cpp b/clang/test/SemaCXX/P1811.cpp
new file mode 100644
index 0000000000000..329110a2ce4dd
--- /dev/null
+++ b/clang/test/SemaCXX/P1811.cpp
@@ -0,0 +1,41 @@
+// RUN: rm -rf %t
+// RUN: split-file %s %t
+
+
+// RUN: %clang_cc1 -std=c++20 -verify -emit-module-interface %t/mod.cpp -o %t/mod.pcm
+// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify -fmodule-file=M=%t/mod.pcm %t/main1.cpp
+// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify -fmodule-file=M=%t/mod.pcm %t/main2.cpp
+
+//--- mod.cpp
+// expected-no-diagnostics
+module;
+#include "A.h"
+export module M;
+export A f() {return A{};}
+
+//--- A.h
+// expected-no-diagnostics
+#ifndef X
+#define X
+
+struct A{};
+
+#endif
+
+//--- main1.cpp
+// expected-no-diagnostics
+#include "A.h"
+import M;
+
+extern "C++" int main() {
+  A a;
+}
+
+//--- main2.cpp
+// expected-no-diagnostics
+import M;
+#include "A.h"
+
+extern "C++" int main() {
+  A a;
+}

diff  --git a/clang/www/cxx_status.html b/clang/www/cxx_status.html
index 831f79f7cf17a..4b149db9ecdf1 100755
--- a/clang/www/cxx_status.html
+++ b/clang/www/cxx_status.html
@@ -911,7 +911,7 @@ <h2 id="cxx20">C++20 implementation status</h2>
       </tr>
       <tr>
         <td><a href="https://wg21.link/p1811r0">P1811R0</a></td>
-        <td class="none" align="center">No</td>
+        <td class="full" align="center">Clang 17</td>
       </tr>
       <tr>
         <td><a href="https://wg21.link/p1703r1">P1703R1</a></td>


        


More information about the cfe-commits mailing list