Commit 899f830
Fix L_Z embedded mangled name in primary expressions
When a template non-type parameter uses a pointer to a function as its
value, the Itanium ABI encodes it as L <mangled-name> E inside the
template argument. DemanglePrimaryExpression() handled this case via
a _Z prefix check, but called DemangleSymbol with m_topLevel=false and
without clearing the outer template substitution table.
This caused T_ / T0_ / ... references inside the embedded symbol's
parameter list to resolve against the outer symbol's template params,
not the inner symbol's, leading to a DemangleException and a complete
demangling failure for these symbols.
Fix: save/clear m_templateSubstitute and set m_topLevel=true before
recursing into DemangleSymbol for the embedded name, then restore
both afterwards. This mirrors the same pattern used by DemangleLocalName.
Also use GetTypeAndName() instead of manually concatenating
GetStringBeforeName() + name + GetStringAfterName() to ensure
proper spacing between return type and function name.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 2bcd77c commit 899f830
1 file changed
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
960 | 960 | | |
961 | 961 | | |
962 | 962 | | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
963 | 969 | | |
964 | | - | |
| 970 | + | |
965 | 971 | | |
966 | 972 | | |
967 | | - | |
968 | | - | |
969 | | - | |
| 973 | + | |
| 974 | + | |
970 | 975 | | |
971 | 976 | | |
972 | 977 | | |
| |||
0 commit comments