This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20123] mangled name of typeid doesn't encode cv-qualifer.
- From: "jody-atd-030903 at atdesk dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Feb 2005 19:33:21 -0000
- Subject: [Bug c++/20123] mangled name of typeid doesn't encode cv-qualifer.
- References: <20050221191203.20123.yanliu@ca.ibm.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From jody-atd-030903 at atdesk dot com 2005-02-24 19:33 -------
I am not on the gcc team, so feel free to take this with some reservation.
According to 5.2.8.5, the top-level cv-qualifier are stripped when calling typeid().
According to 3.9.3.[2,5], cv-qualifiers applied to array types apply to the
array elements, not to the array.
Thus, I think the name you see is correct. In your example, you should be able
to see typeid() doing the right thing (and see that the top-level cv-qualifers
are being stripped) with...
int x[10];
assert(typeid(::v5) == typeid(int[10]));
assert(typeid(::v5) == typeid(x));
assert(strcmp(typeid(::v5).name(), typeid(x).name()) == 0);
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20123