aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Modules/pr119947.cppm
blob: 40de2cad3c0d7b3b720225dad30a2a06ff6620be (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
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 %t/use.cpp -fprebuilt-module-path=%t -emit-llvm -o -


//--- a.cppm
export module a;

struct a_inner {
	~a_inner() {
	}
	void f(auto) {
	}
};

export template<typename T>
struct a {
	a() {
		struct local {};
		inner.f(local());
	}
private:
	a_inner inner;
};


namespace {

struct s {
};

} // namespace

void f() {
	a<s> x;
}

//--- use.cpp
import a;

namespace {

struct s {
};

} // namespace

void g() {
	a<s> x;
}