Repository navigation
fix(templates): avoid reusing specialization without rescan info in C… - #390
jakub-labenski wants to merge 1 commit into
Conversation
|
AcknowlEDG review results updated for
|
|
AcknowlEDG review results updated for
CI success. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
nv-cmeerw
left a comment
There was a problem hiding this comment.
Thanks for working on this, just a few nits.
| @@ -0,0 +1,17 @@ | |||
| [GH #335] | |||
| @@ -0,0 +1,17 @@ | |||
| [GH #335] | |||
| Fix CTAD rescan info for reused specializations | |||
There was a problem hiding this comment.
Usually, the summary line would say something like "Abort ..." for these kind of issues, and then also mention the function (get_expr_rescan_info) in the description. EDGcpfe/26631, EDGcpfe/23606,EDGcpfe/23607, and EDGcpfe/22589,EDGcpfe/23473 described similar issues.
| } /* if */ | ||
| if (eq && (options & CC_EXACT_EQUIVALENCE) && | ||
| (node1->extra.rescan_info != NULL) != | ||
| (node2->extra.rescan_info != NULL)) { |
There was a problem hiding this comment.
minor nit: the continuation line should be right-aligned at column 79.
| @@ -0,0 +1,31 @@ | |||
| //type:fp | |||
| //options_all:--c++17 | |||
There was a problem hiding this comment.
I'd usually also run the test in common emulation modes, e.g.
//options:--c++17:--gnu_version 150200:--clang_version 220100:--ms_c++17 --microsoft_version 1950
…TAD [GH edgcpp#395] compare_expressions checked, under CC_EXACT_EQUIVALENCE, that both nodes either have or lack rescan info. That check only ran when the type comparison was done, and the type comparison is skipped for variable references. As a result, a specialization such as P<b> (b a dependent static data member) created by a member declaration, with no rescan info, could be reused for the same specialization in a constructor parameter type. Then, building the implicit deduction guide for class template argument deduction failed with the internal error "missing default rescan info". Move the rescan info check out of the type comparison block so it applies to all equivalent nodes. Add regression test regressions/ctad-dependent-member-template-arg-reuse.sft.cpp and a Changes entry.
e560a91 to
4d11f84
Compare
|
AcknowlEDG review results updated for
CI success. |
…TAD []
Discussion #336
compare_expressions checked, under CC_EXACT_EQUIVALENCE, that both nodes either have or lack rescan info. That check only ran when the type comparison was done, and the type comparison is skipped for variable references.
As a result, a specialization such as P<b> (b a dependent static data member) created by a member declaration, with no rescan info, could be reused for the same specialization in a constructor parameter type. Then, building the implicit deduction guide for class template argument deduction failed with the internal error "missing default rescan info".
Move the rescan info check out of the type comparison block so it applies to all equivalent nodes.
Add regression test
regressions/ctad-dependent-member-template-arg-reuse.sft.cpp and a Changes entry.
Summary by CodeRabbit