Re: [rfa/symtab/c++] fix c++ rtti type lookup

David Carlton
2003-12-01T17:13:37Z

On Thu, 27 Nov 2003 02:09:03 -0500 (EST), mec.gnu@mindspring.com (Michael Elizabeth Chastain) said:

> This patch is a partial fix for PR c++/1465, which is the bug where
> RTTI lookup gets the "namespace" symbol instead of the class symbol.

Thanks; I can't recommend this for approval, but it basically looks
good to me. A few quibbles:

> I think I need approval from a symtab maintainer to add the new
> utility function "lookup_rtti_type", and then approval from a C++
> maintainer to change gnuv2_rtti_type and gnuv3_rtti_type to call
> lookup_rtti_type.

Just C++ approval is fine - it's not in symtab.c, and we have other
C++-specific symbol-lookup code that was moved out of symtab.c exactly
so that it wouldn't require symtab approval. Though I would put the
new function in cp-namespace.c/cp-support.h, until we decide to create
a cp-symtab.c, because that's where the other C++-specific symtab
stuff currently is.

> + if (SYMBOL_CLASS (rtti_sym) != LOC_TYPEDEF)
> + {
> + warning ("RTTI symbol for class '%s' is not a typedef", name);

I would change this to 'is not a type' - we put them in something
called LOC_TYPEDEF, but users would expect 'typedef' to refer to the
C/C++ meaning of the term.

David Carlton
carlton@kealia.com