xref: /llvm-project/clang/test/Modules/GH77953.cpp (revision 1b6c1a3bd73be4dd904230c637d65810cf3334cd)
1c58bc24fScor3ntin // From https://github.com/llvm/llvm-project/issues/77953
2c58bc24fScor3ntin // RUN: rm -rf %t
3c58bc24fScor3ntin // RUN: mkdir -p %t
4c58bc24fScor3ntin // RUN: split-file %s %t
5c58bc24fScor3ntin 
6c58bc24fScor3ntin // RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/a.cppm -o %t/a.pcm
7*1b6c1a3bSChuanqi Xu // RUN: %clang_cc1 -std=c++20 -fmodule-file=a=%t/a.pcm %t/b.cpp -fsyntax-only -verify
8c58bc24fScor3ntin 
9c58bc24fScor3ntin //--- a.cppm
10c58bc24fScor3ntin export module a;
11c58bc24fScor3ntin 
12c58bc24fScor3ntin template<typename, typename>
13c58bc24fScor3ntin concept c = true;
14c58bc24fScor3ntin 
15c58bc24fScor3ntin export template<typename... Ts>
16c58bc24fScor3ntin struct a {
17c58bc24fScor3ntin 	template<typename... Us> requires(... and c<Ts, Us>)
operator ==(a,a<Us...>)18c58bc24fScor3ntin 	friend bool operator==(a, a<Us...>) {
19c58bc24fScor3ntin 		return true;
20c58bc24fScor3ntin 	}
21c58bc24fScor3ntin };
22c58bc24fScor3ntin 
23c58bc24fScor3ntin template struct a<>;
24c58bc24fScor3ntin 
25*1b6c1a3bSChuanqi Xu //--- b.cpp
26*1b6c1a3bSChuanqi Xu // expected-no-diagnostics
27c58bc24fScor3ntin import a;
28c58bc24fScor3ntin template struct a<int>;
29