This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20123] New: mangled name of typeid doesn't encode cv-qualifer.
- From: "yanliu at ca dot ibm dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Feb 2005 19:12:05 -0000
- Subject: [Bug c++/20123] New: mangled name of typeid doesn't encode cv-qualifer.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Here is a testcase:
#include <typeinfo>
int const volatile v5[10] = {0};
int
main (int argc, char **argv) {
const std::type_info& t = typeid (::v5);
}
According to Itanium C++ ABI, the mangled name of typeid(::v5) should follow
the following grammer rules:
<mangled-name> ::= _Z <encoding>
<encoding> ::= <special-name>
<special-name> ::= TI <type> # typeinfo structure
<type> ::= <array-type>
<array-type> ::= A <positive dimension number> _ <element type>
To my understanding, the element type follows the <type> rule and is used to
encode the type of variable v5[10]:
<type> ::= <CV-qualifiers> <type>
<CV-qualifiers> ::= [r] [V] [K] # restrict (C99), volatile,
const
So the mangled name should be: __ZTIA10_VKi. But using gcc 4.0 compiler, I am
getting "__ZTIA10_i" mangled name instead.
Please verify the problem, thanks.
--
Summary: mangled name of typeid doesn't encode cv-qualifer.
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: yanliu at ca dot ibm dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20123