aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Modules/GH77953.cpp
blob: c0c16f00395bce1d882a3bc33ef4cbca192a5c8e (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
// From https://github.com/llvm/llvm-project/issues/77953
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t

// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/a.cppm -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 -fmodule-file=a=%t/a.pcm %t/b.cpp -fsyntax-only -verify

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

template<typename, typename>
concept c = true;

export template<typename... Ts>
struct a {
	template<typename... Us> requires(... and c<Ts, Us>)
	friend bool operator==(a, a<Us...>) {
		return true;
	}
};

template struct a<>;

//--- b.cpp
// expected-no-diagnostics
import a;
template struct a<int>;