Repository navigation
Template parameter objects of enclosing templates in member template signatures [GH #423] - #464
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Build operands from template parameter object variables src/expr.c, src/exprutil.c, src/exprutil.h |
The rescan fallback calls the new variable-based operand helper. The existing operand function delegates operand construction to that helper. |
Cover member-template and lambda signatures tests/tests/regressions/gh-423.sft.cpp, tests/tests/regressions/.gh-423.rto/*, src/pending_changes/gh-423-template-param-object-member-template.txt |
The C++20 regression test checks member-template, generic-lambda, partial-specialization, and deduced-parameter cases. Runner fixtures specify C++20 compiler modes, and the pending-change entry describes the reported failures. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Possibly related PRs
- edgcpp/compiler#422: Both changes handle class-type non-type template parameters in signatures; this PR extends operand handling to rescanned enclosing-template references.
- edgcpp/compiler#435: Both changes address rescans of template and lambda signatures that refer to enclosing template parameters.
- edgcpp/compiler#339: Both changes cover lambda rescans involving enclosing template parameters.
Suggested labels: bug
Suggested reviewers: wchilders-nvidia, darkarc
Merge Risk: 
Minimal · up to 7b8ac
-
No actionable current-head defect remains from the reviewed changes.
Pre-merge checks: 
4
-
Full details: Title check
-
Explanation
The title names the main change: class-type non-type template parameter objects from enclosing templates, as referenced in member template signatures, and it cites the GH
#423issue. The raw summary and objectives confirm the change adds a variable-operand helper and corrects rescanning so these references are no longer rebuilt as prvalues. The title is specific and on-topic, so it passes.
Full details: Linked Issues check
-
Explanation
Issue
#423requires class-type NTTP references in enclosing-template member-template and generic-lambda signatures to remain const lvalues during substitution.src/expr.cnow callsmake_template_param_object_variable_operandduring rescanning.src/exprutil.cconstructs the const lvalue operand. The regression testtests/tests/regressions/gh-423.sft.cppcovers address-taking deduction, a generic lambda, a partial specialization, member access, and the reportedautoNTTP case. The test includes compile-time type and value assertions for C++20 compiler modes.
Full details: Out of Scope Changes check
-
Explanation
The changes stay within issue
#423. The source changes extract and reuse template-parameter-object operand construction. The added pending-change note, regression source, and regression runner entries document and test the same behavior. No unrelated product behavior or unrelated files appear in the reviewed diff.
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
CodeRabbit Verify
- Run CodeRabbit Verify to test the changes in this pull request.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Fixes #423.
When an enclosing template is instantiated, a reference to one of its class-type nontype template parameters in the signature of a member template (or of a generic lambda) is replaced by the template parameter object. When the member template's own arguments were then substituted,
make_operand_for_rescanned_identifierrebuilt that reference withmake_constant_operand, i.e., as a prvalue rather than a const lvalue. Taking its address therefore made deduction fail (the examples in the issue), and other uses produced a function type inconsistent with that of the template:The part of
make_template_param_object_operandthat builds the const lvalue operand for a template parameter object is now a separate function,make_template_param_object_variable_operand, which the rescan uses instead.Summary by CodeRabbit