Commit 5548ea3
authored
[Clang] Instantiate local constexpr functions eagerly (#95660)
We had a code path in `Sema::MarkFunctionReferenced()` that deferred
local lambda instantiation even for constexprs. This resulted in any
calls to them referring to function decls that lack bodies and hence
failures at constant evaluation.
The issue doesn't occur when the lambda has no explicit return type
because the return type deduction requires instantiation.
Fixes #35052
Fixes #948491 parent d442bf0 commit 5548ea3
File tree
3 files changed
+32
-6
lines changed- clang
- docs
- lib/Sema
- test/SemaTemplate
3 files changed
+32
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
858 | 858 | | |
859 | 859 | | |
860 | 860 | | |
| 861 | + | |
861 | 862 | | |
862 | 863 | | |
863 | 864 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18112 | 18112 | | |
18113 | 18113 | | |
18114 | 18114 | | |
18115 | | - | |
18116 | | - | |
18117 | | - | |
18118 | | - | |
18119 | | - | |
18120 | | - | |
| 18115 | + | |
18121 | 18116 | | |
18122 | 18117 | | |
18123 | 18118 | | |
18124 | 18119 | | |
| 18120 | + | |
| 18121 | + | |
| 18122 | + | |
| 18123 | + | |
| 18124 | + | |
| 18125 | + | |
18125 | 18126 | | |
18126 | 18127 | | |
18127 | 18128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
509 | 510 | | |
510 | 511 | | |
511 | 512 | | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
0 commit comments