+2002-12-01 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/8727
+ * cp-tree.h (lang_type_class): Add typeinfo_var.
+ (CLASSTYPE_TYPEINFO_VAR): New macro.
+ * rtti.c (get_tinfo_decl): Use it.
+
+ PR c++/8663
+ * init.c (expand_member_init): Always get the main variant of a
+ base class.
+
2002-12-01 Mark Mitchell <mark@codesourcery.com>
PR c++/8332
tree primary_base;
tree vfields;
+ tree typeinfo_var;
tree vbases;
tree tags;
tree size;
/* Used by various search routines. */
#define IDENTIFIER_MARKED(NODE) TREE_LANG_FLAG_0 (NODE)
\f
+/* The std::type_info variable representing this class, or NULL if no
+ such variable has been created. This field is only set for the
+ TYPE_MAIN_VARIANT of the class. */
+#define CLASSTYPE_TYPEINFO_VAR(NODE) \
+ (TYPE_LANG_SPECIFIC (NODE)->typeinfo_var)
+
/* Accessor macros for the vfield slots in structures. */
/* The virtual function pointer fields that this type contains. For a
}
else if (TYPE_P (name))
{
- basetype = name;
+ basetype = TYPE_MAIN_VARIANT (name);
name = TYPE_NAME (name);
}
else if (TREE_CODE (name) == TYPE_DECL)
type = build_function_type (TREE_TYPE (type),
TREE_CHAIN (TYPE_ARG_TYPES (type)));
+ /* For a class type, the variable is cached in the type node
+ itself. */
+ if (CLASS_TYPE_P (type))
+ {
+ d = CLASSTYPE_TYPEINFO_VAR (TYPE_MAIN_VARIANT (type));
+ if (d)
+ return d;
+ }
+
name = mangle_typeinfo_for_type (type);
d = IDENTIFIER_GLOBAL_VALUE (name);
pushdecl_top_level (d);
+ if (CLASS_TYPE_P (type))
+ CLASSTYPE_TYPEINFO_VAR (TYPE_MAIN_VARIANT (type)) = d;
+
/* Remember the type it is for. */
TREE_TYPE (name) = type;
}
+2002-12-01 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/8727
+ * g++.dg/inherit/typeinfo1.C: New test.
+
+ PR c++/8663
+ * g++.dg/inherit/typedef1.C: New test.
+
2002-11-30 Mark Mitchell <mark@codesourcery.com>
PR c++/8332