aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Modules/pr133057.cpp
blob: b273fc318058ee65f3e178443d390f609e2326c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -xc++ -std=c++20 -emit-module -fmodule-name=hf -fno-cxx-modules -fmodules -fno-implicit-modules %t/CMO.cppmap -o %t/WI9.pcm
// RUN: %clang_cc1 -xc++ -std=c++20 -emit-module -fmodule-name=g -fno-cxx-modules -fmodules -fno-implicit-modules -fmodule-file=%t/WI9.pcm %t/E6H.cppmap -o %t/4BK.pcm
// RUN: %clang_cc1 -xc++ -std=c++20 -emit-module -fmodule-name=r -fno-cxx-modules -fmodules -fno-implicit-modules -fmodule-file=%t/WI9.pcm %t/HMT.cppmap -o %t/LUM.pcm
// RUN: %clang_cc1 -xc++ -std=c++20 -emit-module -fmodule-name=q -fno-cxx-modules -fmodules -fno-implicit-modules -fmodule-file=%t/LUM.pcm -fmodule-file=%t/4BK.pcm %t/JOV.cppmap -o %t/9VX.pcm
// RUN: %clang_cc1 -xc++ -std=c++20 -verify -fsyntax-only -fno-cxx-modules -fmodules -fno-implicit-modules -fmodule-file=%t/9VX.pcm %t/XFD.cc

//--- 2OT.h
#include "LQ1.h"

namespace ciy {
namespace xqk {
template <typename>
class vum {
 public:
  using sc = std::C::wmd;
  friend bool operator==(vum, vum);
};
template <typename>
class me {
 public:
  using vbh = vum<me>;
  using sc = std::C::vy<vbh>::sc;
  template <typename db>
  operator db() { return {}; }
};
}  // namespace xqk
template <typename vus>
xqk::me<vus> uvo(std::C::wmd, vus);
}  // namespace ciy

class ua {
  std::C::wmd kij() {
    ciy::uvo(kij(), '-');
    return {};
  }
};

//--- 9KF.h
#include "LQ1.h"
#include "2OT.h"
namespace {
void al(std::C::wmd lou) { std::C::jv<std::C::wmd> yt = ciy::uvo(lou, '/'); }
}  // namespace

//--- CMO.cppmap
module "hf" {
header "LQ1.h"
}


//--- E6H.cppmap
module "g" {
export *
header "2OT.h"
}


//--- HMT.cppmap
module "r" {
header "2OT.h"
}


//--- JOV.cppmap
module "q" {
header "9KF.h"
}


//--- LQ1.h
namespace std {
namespace C {
template <class zd>
struct vy : zd {};
template <class ub>
struct vy<ub*> {
  typedef ub jz;
};
struct wmd {};
template <class uo, class zt>
void sk(uo k, zt gf) {
  (void)(k != gf);
}
template <class uo>
class fm {
 public:
  fm(uo);
};
template <class kj, class kju>
bool operator==(kj, kju);
template <class epn>
void afm(epn) {
  using yp = vy<epn>;
  if (__is_trivially_copyable(yp)) {
    sk(fm(epn()), nullptr);
  }
}
template <class ub>
class jv {
 public:
  constexpr void gq();
  ub *nef;
};
template <class ub>
constexpr void jv<ub>::gq() {
    afm(nef);
}
}  // namespace C
}  // namespace std
namespace ciy {
}  // namespace ciy

//--- XFD.cc
// expected-no-diagnostics
#include "LQ1.h"
#include "2OT.h"
class wiy {
 public:
  std::C::wmd eyb();
};
template <typename wpa>
void i(wpa fg) {
  std::C::jv<std::C::wmd> zs;
  zs = ciy::uvo(fg.eyb(), '\n');
}
namespace ciy {
namespace xqk {
struct sbv;
std::C::jv<sbv> ns() {
  std::C::jv<sbv> ubs;
  ubs.gq();
  return ubs;
}
}  // namespace xqk
}  // namespace ciy
void s() {
  wiy fg;
  i(fg);
}