Debian Codegraph @

clang/test/Modules/module-local-hidden-friend-2.cppm

raw
1 // RUN: rm -rf %t
2 // RUN: split-file %s %t
3 // RUN: cd %t
4 //
5 // RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-module-interface -o %t/a.pcm
6 // RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-module-interface -o %t/b.pcm \
7 // RUN: -fmodule-file=a=%t/a.pcm
8 // RUN: %clang_cc1 -std=c++20 %t/use.cc -fmodule-file=a=%t/a.pcm -fmodule-file=b=%t/b.pcm \
9 // RUN: -fsyntax-only -verify
10 //
11 // RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm
12 // RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-reduced-module-interface -o %t/b.pcm \
13 // RUN: -fmodule-file=a=%t/a.pcm
14 // RUN: %clang_cc1 -std=c++20 %t/use.cc -fmodule-file=a=%t/a.pcm -fmodule-file=b=%t/b.pcm \
15 // RUN: -fsyntax-only -verify
16
17 //--- a.cppm
18 export module a;
19
20 namespace n {
21 }
22
23 //--- b.cppm
24 export module b;
25 import a;
26
27 namespace n {
28 struct monostate {
29 friend bool operator==(monostate, monostate) = default;
30 };
31
32 export struct wrapper {
33 friend bool operator==(wrapper const &, wrapper const &) = default;
34
35 monostate m_value;
36 };
37 }
38
39 //--- use.cc
40 // expected-no-diagnostics
41 import b;
42
43 static_assert(n::wrapper() == n::wrapper());