Skip to content

Commit bb3b830

Browse files
committed
[NFC] [C++20] [Modules] Add a test module local declaration lookup
From #143734, but it looks good on trunk. Add it as tests are always good.
1 parent 082251b commit bb3b830

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// RUN: rm -rf %t
2+
// RUN: mkdir -p %t
3+
// RUN: split-file %s %t
4+
//
5+
// RUN: %clang_cc1 -std=c++20 %t/Base.cppm -emit-module-interface -o %t/Base.pcm
6+
// RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-module-interface -o %t/A.pcm -fprebuilt-module-path=%t
7+
// RUN: %clang_cc1 -std=c++20 %t/B.cppm -fsyntax-only -verify -fprebuilt-module-path=%t
8+
9+
//--- Base.cppm
10+
export module Base;
11+
export template <class T>
12+
class Base {};
13+
14+
//--- A.cppm
15+
export module A;
16+
import Base;
17+
struct S {};
18+
19+
export Base<S> a;
20+
21+
//--- B.cppm
22+
// expected-no-diagnostics
23+
export module B;
24+
25+
import A;
26+
import Base;
27+
28+
struct S {};
29+
30+
export Base<S> b;

0 commit comments

Comments
 (0)