Tolerate clang SUBSTPACK placeholders#313
Tolerate clang SUBSTPACK placeholders#313kristjanvalur wants to merge 9 commits intogimli-rs:masterfrom
Conversation
|
I think the goal here is fine but there's at least one big issue with the implementation. In your PR a comment says "They are intentionally non-substitutable so that synthetic recovery tokens do not perturb real But they clearly are substitutable in at least one case (the break on line 2425 will go to line 2431). (This is probably an oversight by the clang developers but that's the price of admission when trying to demangle symbols they didn't expect anyone to try to demangle). |
|
Great catch. I was assuming this was just ignorable noise, but you are right. |
Summary
Motivation and Context
The SUBSTPACK / SUBSTBUILTINPACK markers are clang-emitted compatibility artifacts (from fallback code paths in clang's mangler), not standard Itanium grammar productions. They still appear in production symbol streams, so strict parsing causes avoidable failures.
Behavior Contract
This PR treats those markers as recovery-only noise tokens for parsing purposes, while rendering a visible placeholder in demangled output:
Rationale:
Additional guardrail:
Scope
Validation