https://github.com/kish1n created https://github.com/llvm/llvm-project/pull/146993
This is already implemented. See godbolt: https://godbolt.org/z/7x3arqj3G >From 62f10d478d8d99f3aaf8a3b8dfff299e42ce8557 Mon Sep 17 00:00:00 2001 From: Ashwin Banwari <ashwinkbanw...@gmail.com> Date: Thu, 3 Jul 2025 20:35:15 -0700 Subject: [PATCH] mark P1811 as implemented and add test --- clang/test/SemaCXX/P1811.cpp | 41 ++++++++++++++++++++++++++++++++++++ clang/www/cxx_status.html | 2 +- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 clang/test/SemaCXX/P1811.cpp 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> _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits