-
Notifications
You must be signed in to change notification settings - Fork 10.8k
/
pr63595.cppm
46 lines (39 loc) · 865 Bytes
/
pr63595.cppm
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
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 -emit-module-interface -I%t %t/module1.cppm -o %t/module1.pcm
// RUN: %clang_cc1 -std=c++20 -emit-module-interface -I%t %t/module2.cppm -o %t/module2.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/merge.cpp -verify -fsyntax-only
//--- header.h
namespace NS {
template <int I>
class A {
};
template <template <int I_> class T>
class B {
};
}
//--- module1.cppm
// inside NS, using C = B<A>
module;
#include "header.h"
export module module1;
namespace NS {
using C = B<A>;
}
export struct D : NS::C {};
//--- module2.cppm
// inside NS, using C = B<NS::A>
module;
#include "header.h"
export module module2;
namespace NS {
using C = B<NS::A>;
}
export struct D : NS::C {};
//--- merge.cpp
// expected-no-diagnostics
import module1;
import module2;
D d;