Fix missing symbols for template alias arguments during codegen#22849
Fix missing symbols for template alias arguments during codegen#22849oCHIKIo wants to merge 1 commit intodlang:masterfrom
Conversation
|
Thanks for your pull request and interest in making D better, @oCHIKIo! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#22849" |
af81842 to
b116364
Compare
|
A function passed as a template parameter doesn't need code gen when it's not used, that is intentional. In the issue's test case, neither function needs code gen. |
Fixes #22848
i discovered that the compiler was skipping code generation for symbols (like nested functions) when they were passed only as alias arguments to templates. this resulted in "undefined reference" linker errors because the backend never visited those dependencies.
this PR adds a traversal of template arguments (tiargs) to the toObjFile visitor in toobj.d. this ensures that all symbols required by a non-speculative template instantiation are correctly processed for code generation.