Commit 3127761
committed
[Clang] Don't form a type constraint if the concept is invalid
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.1 parent d34f7ea commit 3127761
File tree
3 files changed
+15
-1
lines changed- clang
- lib
- Sema
- Serialization
- test/SemaTemplate
3 files changed
+15
-1
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 | |
|---|---|---|---|
| |||
1951 | 1951 | | |
1952 | 1952 | | |
1953 | 1953 | | |
1954 | | - | |
1955 | 1954 | | |
1956 | 1955 | | |
1957 | 1956 | | |
| |||
| 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