Bug 65035
Summary: | g++3 makes wrong mangled name for template cast operator | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Grigory Zagorodnev <grigory_zagorodnev> |
Component: | gcc3 | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | |
Severity: | high | Docs Contact: | |
Priority: | medium | ||
Version: | 7.2 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2002-12-15 20:22:32 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Grigory Zagorodnev
2002-05-16 13:39:27 UTC
Your expected mangling is not even accepted by c++filt as valid. Can you please explain why do you think it is mangled improperly? 1. Clarify the issue Unfortunately, the mangling grammer given in the ABI is ambiguous in this area, so we need to think more about it. First of all, let's decompose the mangled name taking GCC's encoding (it does not matter which one to take). We are interesting in the following parts of '_ZN1CcviIiEEv' mangled name: a) cvi # <operator-name> ::= cv <type> b) IiE # <template-args> ::= I <type>+ E In both parts, value of <type> used to be the same. And it is really the same 8- ). But, only one question is there: Which part should be encoded/decoded first? (the hen or the egg) As I can see, part a) depends on type value of b). So the <type> in the a should be a reference to template argument from b. 2. Clarify compiler behaviour Let's change our example to make the behaviour more clean and see what exactly compilers are doing. According to the ABI, built-in types are not substituted, so it's better to change built-in type 'int' to some class 'A'. Now we that g++3 encodes operator as: _ZN1Ccv1AIS0_EEv i.e. type 1A in the part (a) of mangled name becomes major one, and part (b) reference it by <substitution> While the correct code is: _ZN1CcvT_I1AEEv where part (a) depends from type specified in part (b) so it reference it as <template-param>. 3. Decoder Yes, c++filt is not able to decode given names. But decoder is not guilty. The root of the problem is the mangling grammer. Correct result produced by 8.0 g++ 3.2 |