[clang] [NFC] [C++] [Modules] Mark P2115 as implemented and add test (PR #147489)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 8 02:11:23 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Ashwin Kishin Banwari (kish1n)
<details>
<summary>Changes</summary>
This is already implemented. Proposal: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2115r0.html
---
Full diff: https://github.com/llvm/llvm-project/pull/147489.diff
2 Files Affected:
- (added) clang/test/SemaCXX/P2115.cpp (+21)
- (modified) clang/www/cxx_status.html (+1-1)
``````````diff
diff --git a/clang/test/SemaCXX/P2115.cpp b/clang/test/SemaCXX/P2115.cpp
new file mode 100644
index 0000000000000..4389be992440b
--- /dev/null
+++ b/clang/test/SemaCXX/P2115.cpp
@@ -0,0 +1,21 @@
+// RUN: rm -rf %t
+// RUN: split-file %s %t
+
+
+// RUN: %clang -std=c++20 -fmodule-header %t/A.h -o %t/A.pcm
+// RUN: %clang -std=c++20 -fmodule-header %t/B.h -o %t/B.pcm
+// RUN: %clang -std=c++20 -fsyntax-only -fmodule-file=%t/A.pcm -fmodule-file=%t/B.pcm %t/main.cpp
+
+//--- A.h
+// expected-no-diagnostics
+enum { A = 0 };
+
+//--- B.h
+// expected-no-diagnostics
+enum { B = 1 };
+
+//--- main.cpp
+// expected-no-diagnostics
+import "A.h";
+import "B.h";
+int main() {}
diff --git a/clang/www/cxx_status.html b/clang/www/cxx_status.html
index 831f79f7cf17a..1920c8fc79396 100755
--- a/clang/www/cxx_status.html
+++ b/clang/www/cxx_status.html
@@ -935,7 +935,7 @@ <h2 id="cxx20">C++20 implementation status</h2>
</tr>
<tr>
<td><a href="https://wg21.link/p2115r0">P2115R0</a></td>
- <td class="partial" align="center">Partial</td>
+ <td class="full" align="center">Yes</td>
</tr>
<tr>
<td><a href="https://wg21.link/p1815r2">P1815R2</a></td>
``````````
</details>
https://github.com/llvm/llvm-project/pull/147489
More information about the cfe-commits
mailing list