[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / PCH / cxx2a-constraints.cpp
blob3f3b5e536cc93457b304148e10d7a69ac9e6fed9
1 // RUN: %clang_cc1 -std=c++2a -emit-pch %s -o %t
2 // RUN: %clang_cc1 -std=c++2a -include-pch %t -verify %s
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
7 // expected-no-diagnostics
9 #ifndef HEADER
10 #define HEADER
12 template<typename T, typename U = char>
13 concept SizedLike = sizeof(T) == sizeof(U);
15 template <class T> void f(T) requires (sizeof(int) == sizeof(T)) {}
16 template <class T> void f(T) requires (sizeof(char) == sizeof(T)) {}
18 template <class T> requires (sizeof(int) == sizeof(T)) void g(T) {}
19 template <class T> requires (sizeof(char) == sizeof(T)) void g(T) {}
21 template <SizedLike<int> T> void h(T) {}
22 template <SizedLike<char> T> void h(T) {}
24 template <SizedLike<int> T> void i(T) {}
25 template <SizedLike T> void i(T) {}
27 void j(SizedLike<int> auto ...ints) {}
29 #else /*included pch*/
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);
43 #endif // HEADER