1 // RUN: %clang_cc1 -std=c++2a -emit-pch %s -o %t
2 // RUN: %clang_cc1 -std=c++2a -include-pch %t -verify %s
3
4 // RUN: %clang_cc1 -std=c++2a -emit-pch -fpch-instantiate-templates %s -o %t
5 // RUN: %clang_cc1 -std=c++2a -include-pch %t -verify %s
6
7 // expected-no-diagnostics
8
9 #ifndef HEADER
10 #define HEADER
11
12 template<typename T, typename U = char>
13 concept SizedLike = sizeof(T) == sizeof(U);
14
f(T)15 template <class T> void f(T) requires (sizeof(int) == sizeof(T)) {}
f(T)16 template <class T> void f(T) requires (sizeof(char) == sizeof(T)) {}
17
g(T)18 template <class T> requires (sizeof(int) == sizeof(T)) void g(T) {}
g(T)19 template <class T> requires (sizeof(char) == sizeof(T)) void g(T) {}
20
h(T)21 template <SizedLike<int> T> void h(T) {}
h(T)22 template <SizedLike<char> T> void h(T) {}
23
i(T)24 template <SizedLike<int> T> void i(T) {}
i(T)25 template <SizedLike T> void i(T) {}
26
j(SizedLike<int> auto...ints)27 void j(SizedLike<int> auto ...ints) {}
28
29 #else /*included pch*/
30
main()31 int main() {
32 (void)f('1');
33 (void)f(1);
34 (void)g('1');
35 (void)g(1);
36 (void)h('1');
37 (void)h(1);
38 (void)i('1');
39 (void)i(1);
40 (void)j(1, 2, 3);
41 }
42
43 #endif // HEADER
44