Skip to content

Normalize local-source template handling in nested names#316

Open
kristjanvalur wants to merge 9 commits intogimli-rs:masterfrom
kristjanvalur:pr2c-cxx20-local-source-normalization-clean
Open

Normalize local-source template handling in nested names#316
kristjanvalur wants to merge 9 commits intogimli-rs:masterfrom
kristjanvalur:pr2c-cxx20-local-source-normalization-clean

Conversation

@kristjanvalur
Copy link
Copy Markdown

@kristjanvalur kristjanvalur commented Apr 15, 2026

Summary

  • normalize local-source-name template handling across nested-name paths

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 (auto parameters), 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

  • local-source-name template argument handling in nested contexts
  • normalization/scope behavior for nested-name template argument lookup

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant