Commit a413c56
authored
[Clang][Sema] Fix a bug on template partial specialization with issue on deduction of nontype template parameter (#90376)
Fix #68885
When build expression from a deduced argument whose kind is
`Declaration` and `NTTPType`(which declared as `decltype(auto)`) is
deduced as a reference type, `BuildExpressionFromDeclTemplateArgument`
just create a `DeclRef`. This is incorrect while we get type from the
expression since we can't get the original reference type from
`DeclRef`. Creating a `SubstNonTypeTemplateParmExpr` expression and make
the deduction correct. `Replacement` expression of
`SubstNonTypeTemplateParmExpr` just helps the deduction and may not be
same with the original expression.
Co-authored-by: huqizhi <[email protected]>1 parent eaee8aa commit a413c56
File tree
5 files changed
+50
-12
lines changed- clang
- docs
- include/clang/Sema
- lib/Sema
- test/SemaCXX
5 files changed
+50
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
612 | 612 | | |
613 | 613 | | |
614 | 614 | | |
| 615 | + | |
| 616 | + | |
615 | 617 | | |
616 | 618 | | |
617 | 619 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9249 | 9249 | | |
9250 | 9250 | | |
9251 | 9251 | | |
9252 | | - | |
| 9252 | + | |
| 9253 | + | |
9253 | 9254 | | |
9254 | 9255 | | |
9255 | 9256 | | |
| |||
9572 | 9573 | | |
9573 | 9574 | | |
9574 | 9575 | | |
9575 | | - | |
9576 | | - | |
9577 | | - | |
| 9576 | + | |
| 9577 | + | |
| 9578 | + | |
| 9579 | + | |
9578 | 9580 | | |
9579 | 9581 | | |
9580 | 9582 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8438 | 8438 | | |
8439 | 8439 | | |
8440 | 8440 | | |
8441 | | - | |
8442 | | - | |
8443 | | - | |
8444 | | - | |
| 8441 | + | |
| 8442 | + | |
| 8443 | + | |
8445 | 8444 | | |
8446 | 8445 | | |
8447 | 8446 | | |
| |||
8508 | 8507 | | |
8509 | 8508 | | |
8510 | 8509 | | |
| 8510 | + | |
| 8511 | + | |
| 8512 | + | |
| 8513 | + | |
| 8514 | + | |
| 8515 | + | |
| 8516 | + | |
| 8517 | + | |
| 8518 | + | |
| 8519 | + | |
| 8520 | + | |
| 8521 | + | |
8511 | 8522 | | |
8512 | 8523 | | |
8513 | 8524 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2639 | 2639 | | |
2640 | 2640 | | |
2641 | 2641 | | |
2642 | | - | |
| 2642 | + | |
| 2643 | + | |
2643 | 2644 | | |
2644 | 2645 | | |
2645 | 2646 | | |
| |||
2651 | 2652 | | |
2652 | 2653 | | |
2653 | 2654 | | |
2654 | | - | |
| 2655 | + | |
| 2656 | + | |
2655 | 2657 | | |
2656 | 2658 | | |
2657 | 2659 | | |
| |||
2718 | 2720 | | |
2719 | 2721 | | |
2720 | 2722 | | |
2721 | | - | |
2722 | | - | |
| 2723 | + | |
| 2724 | + | |
2723 | 2725 | | |
2724 | 2726 | | |
2725 | 2727 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
0 commit comments