///////////////////////////////////////////////
#include <stdio.h>
#include <typeinfo>

class _A12345 {
  virtual ~_A12345() {}
};

extern "C" {
  void foo() { }
  void foo2() { }
}

#define ClassName _A12345

int main() {
  printf("%s\n",typeid(ClassName).name());
  printf("%s\n",typeid(foo).name());
  printf("%s\n",typeid(foo2).name());
  return 0;
}
///////////////////////////////////////////////

Output:
7_A12345
FvvE
FvvE

1. I think should be "_A12345" instead "7_A12345".
2. foo/foo2 is different types so names must have difference too.
3. extern "C" i think should turn off name mangling, but it isn't.


-- 
           Summary: typeid(*).name() returns wrong values
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: andry at inbox dot ru
  GCC host triplet: i686-pc-cygwin


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35060

Reply via email to