Commit edf14ed
authored
[Clang] Don't form a type constraint if the concept is invalid (llvm#122065)
After 0dedd6f and 03229e7, invalid concept declarations might lack
expressions for evaluation and normalization. This could make it crash
in certain scenarios, apart from the one of evaluation concepts showed
in 03229e7, there's also an issue when checking specializations where
the normalization also relies on a non-null expression.
This patch prevents that by avoiding building up a type constraint in
such situations, thereafter the template parameter wouldn't have a
concept specialization of a null expression.
With this patch, the assumption in ASTWriterDecl is no longer valid.
Namely, HasConstraint and TypeConstraintInitialized must now represent
different meanings for both source fidelity and semantic requirements.
Fixes llvm#115004
Fixes llvm#1219801 parent bfa711a commit edf14ed
File tree
4 files changed
+20
-3
lines changed- clang
- lib
- Sema
- Serialization
- test/SemaTemplate
4 files changed
+20
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4557 | 4557 | | |
4558 | 4558 | | |
4559 | 4559 | | |
| 4560 | + | |
| 4561 | + | |
| 4562 | + | |
4560 | 4563 | | |
4561 | 4564 | | |
4562 | 4565 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2663 | 2663 | | |
2664 | 2664 | | |
2665 | 2665 | | |
2666 | | - | |
| 2666 | + | |
| 2667 | + | |
2667 | 2668 | | |
2668 | 2669 | | |
2669 | 2670 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1951 | 1951 | | |
1952 | 1952 | | |
1953 | 1953 | | |
1954 | | - | |
| 1954 | + | |
| 1955 | + | |
1955 | 1956 | | |
1956 | 1957 | | |
1957 | 1958 | | |
| |||
1969 | 1970 | | |
1970 | 1971 | | |
1971 | 1972 | | |
1972 | | - | |
| 1973 | + | |
1973 | 1974 | | |
1974 | 1975 | | |
1975 | 1976 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1165 | 1165 | | |
1166 | 1166 | | |
1167 | 1167 | | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
0 commit comments