Skip to content

Conversation

@kish1n
Copy link
Contributor

@kish1n kish1n commented Jul 3, 2025

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Jul 3, 2025
@llvmbot
Copy link
Member

llvmbot commented Jul 3, 2025

@llvm/pr-subscribers-clang

Author: Ashwin Kishin Banwari (kish1n)

Changes

Proposal https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1979r0.html appears to already be implemented as of Clang17. See: https://godbolt.org/z/h59Mvzq6P


Full diff: https://github.com/llvm/llvm-project/pull/146841.diff

2 Files Affected:

  • (added) clang/test/SemaCXX/P1979.cpp (+40)
  • (modified) clang/www/cxx_status.html (+1-1)
diff --git a/clang/test/SemaCXX/P1979.cpp b/clang/test/SemaCXX/P1979.cpp
new file mode 100644
index 0000000000000..9c8d02ed28f94
--- /dev/null
+++ b/clang/test/SemaCXX/P1979.cpp
@@ -0,0 +1,40 @@
+// RUN: rm -rf %t
+// RUN: split-file %s %t
+
+
+// RUN: %clang_cc1 -std=c++20 -verify -emit-module-interface %t/A.cpp -o %t/A.pcm
+// RUN: %clang_cc1 -std=c++20 -verify -emit-module-interface %t/myV.cpp -o %t/myV.pcm
+// RUN: %clang_cc1 -std=c++20 -verify -emit-module-interface -fmodule-file=V=%t/myV.pcm %t/partition.cpp -o %t/partition.pcm
+// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify -fmodule-file=V=%t/myV.pcm -fmodule-file=A=%t/A.pcm -fmodule-file=A:partition=%t/partition.pcm %t/interface.cpp
+
+//--- A.cpp
+// expected-no-diagnostics
+export module A;
+
+//--- myV.cpp
+// expected-no-diagnostics
+export module V;
+
+export struct myV{};
+
+//--- uses_vector.h
+// expected-no-diagnostics
+#ifndef x
+#define x
+
+import V;
+#endif
+
+//--- partition.cpp
+// expected-no-diagnostics
+module;
+#include "uses_vector.h" // textually expands to import V;
+module A:partition;
+
+//--- interface.cpp
+module;
+// #include "uses_vector.h"
+module A;
+import :partition;
+myV V; // expected-error {{declaration of 'myV' must be imported from module 'V' before it is required}}
+       // [email protected]:4 {{declaration here is not visible}}
diff --git a/clang/www/cxx_status.html b/clang/www/cxx_status.html
index e5f51bfb2e36e..831f79f7cf17a 100755
--- a/clang/www/cxx_status.html
+++ b/clang/www/cxx_status.html
@@ -923,7 +923,7 @@ <h2 id="cxx20">C++20 implementation status</h2>
       </tr>
       <tr> <!-- from Belfast -->
         <td><a href="https://wg21.link/p1979r0">P1979R0</a></td>
-        <td class="none" align="center">No</td>
+        <td class="full" align="center">Clang 17</td>
       </tr>
       <tr> <!-- from Prague -->
         <td><a href="https://wg21.link/p1779r3">P1779R3</a></td>

@kish1n
Copy link
Contributor Author

kish1n commented Jul 3, 2025

CC @ChuanqiXu9 , @cor3ntin for review

@ChuanqiXu9 ChuanqiXu9 merged commit ca0b566 into llvm:main Jul 3, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants