Itanium ABI: incorrect mangling of unresolved operator name
| Bugzilla Link | 22584 |
| Resolution | FIXED |
| Resolved on | Feb 25, 2015 11:40 |
| Version | trunk |
| OS | Linux |
| CC | @majnemer,@DougGregor |
Extended Description
Given the following case:
struct S4 {
S4 operator-(S4 rhs) { return rhs; }
};
template
clang (r229188) mangles the explicit instantiation of kkk() as: Z3kkkI2S4EDTadsrT_miES1
when the correct mangling should be:
Z3kkkI2S4EDTadsrT_onmiES1 (note the additional "on")
The crux is here that T::operator- is an unresolved name and the ABI (chapter 5.1.5) gives the following:
and, later, in an example
template<class T> auto f(T p)->decltype(&T::operator-);
// The return type in the mangling of the template signature
// is encoded as "DTadsrT_onmiE".
gcc 4.8.2 is inconsistent. With the above example, it matches clang's mangling, but with the following example
struct S4 {
S4(int a) {}
};
S4 operator+(S4 lhs, S4 rhs) { return rhs; }
template
gcc mangles the instantiation of g() correctly to: Z1gI2S4EDTclonplfp_fp_EET
whereas clang leaves out the "on" Z1gI2S4EDTclplfp_fp_EET
Fixed in r229255.
This revision is incorrect, it was r230512.
Wrong PR, sorry for the noise.
Fixed in r229255.
This revision is incorrect, it was r230512.
Fixed in r229255.
assigned to @majnemer