Skip to content

Commit 84be785

Browse files
authored
[NFC] [C++] [Modules] Mark P1811 as implemented and add test (#146993)
This is already implemented. See godbolt: https://godbolt.org/z/7x3arqj3G
1 parent 181b014 commit 84be785

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

clang/test/SemaCXX/P1811.cpp

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// RUN: rm -rf %t
2+
// RUN: split-file %s %t
3+
4+
5+
// RUN: %clang_cc1 -std=c++20 -verify -emit-module-interface %t/mod.cpp -o %t/mod.pcm
6+
// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify -fmodule-file=M=%t/mod.pcm %t/main1.cpp
7+
// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify -fmodule-file=M=%t/mod.pcm %t/main2.cpp
8+
9+
//--- mod.cpp
10+
// expected-no-diagnostics
11+
module;
12+
#include "A.h"
13+
export module M;
14+
export A f() {return A{};}
15+
16+
//--- A.h
17+
// expected-no-diagnostics
18+
#ifndef X
19+
#define X
20+
21+
struct A{};
22+
23+
#endif
24+
25+
//--- main1.cpp
26+
// expected-no-diagnostics
27+
#include "A.h"
28+
import M;
29+
30+
extern "C++" int main() {
31+
A a;
32+
}
33+
34+
//--- main2.cpp
35+
// expected-no-diagnostics
36+
import M;
37+
#include "A.h"
38+
39+
extern "C++" int main() {
40+
A a;
41+
}

clang/www/cxx_status.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ <h2 id="cxx20">C++20 implementation status</h2>
911911
</tr>
912912
<tr>
913913
<td><a href="https://wg21.link/p1811r0">P1811R0</a></td>
914-
<td class="none" align="center">No</td>
914+
<td class="full" align="center">Clang 17</td>
915915
</tr>
916916
<tr>
917917
<td><a href="https://wg21.link/p1703r1">P1703R1</a></td>

0 commit comments

Comments
 (0)