Normalize local-source template handling in nested names#316
Open
kristjanvalur wants to merge 9 commits intogimli-rs:masterfrom
Open
Normalize local-source template handling in nested names#316kristjanvalur wants to merge 9 commits intogimli-rs:masterfrom
kristjanvalur wants to merge 9 commits intogimli-rs:masterfrom
Conversation
Follow-up to local-source template-arg support work (de6f393) and subsequent nested template-arg scope adjustments (70ded5f). When compatibility local-source names carry embedded template args (L<source-name><template-args>), reinterpret them as unscoped-template names during Name parsing so substitution numbering aligns with S0/S1 references. Adds FindBounds regression probes for parse+demangle.
This was referenced Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Motivation and Context
This is one part of a larger C++20 Itanium compatibility effort derived from real-world symbol corpus failures.
These C++20-oriented changes are intentionally split into three PRs for reviewability:
This PR focuses on local-source and nested-name normalization behavior that interacts with C++20 template forms seen in production symbols.
What Changed In C++20 That This Addresses
C++20 increased the frequency and complexity of template-heavy local entities in mangled names, especially through features like constrained templates, abbreviated templates (
autoparameters), and richer lambda usage in templated contexts.As a result, compilers now emit more nested-name shapes where local-source-name components can carry or interact with template-argument context. Pre-C++20 assumptions that those local components were mostly terminal/simple are less reliable on modern binaries.
This PR updates parsing/normalization so those local-source template forms are handled consistently inside nested names, preserving correct scope/template-argument association during demangling.
Scope