[Serialization] Handle uninitialized type constraints
[llvm-project.git] / clang / test / PCH / cxx2a-constraints-crash.cpp
blob6126a0509fa4a9dec6b5041d1556785b7a2deb87
1 // RUN: %clang_cc1 -std=c++2a -fallow-pch-with-compiler-errors -emit-pch -o %t %s -verify
2 // RUN: %clang_cc1 -std=c++2a -fallow-pch-with-compiler-errors -include-pch %t %s -verify
4 #ifndef HEADER
5 #define HEADER
7 template <typename T, typename U>
8 concept not_same_as = true;
10 template <int Kind>
11 struct subrange {
12 template <not_same_as<int> R>
13 subrange(R) requires(Kind == 0);
15 template <not_same_as<int> R>
16 subrange(R) requires(Kind != 0);
19 template <typename R>
20 subrange(R) -> subrange<42>;
22 int main() {
23 int c;
24 subrange s(c);
27 #endif
29 namespace GH99036 {
31 template <typename T>
32 concept C; // expected-error {{expected '='}}
34 template <C U> void f(); // expected-error {{unknown type name 'C'}}
36 } // namespace GH99036