aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/rtti.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-01-17 20:14:44 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-01-17 20:14:44 +0000
commit5dae1114bb636a814b154c3c47ff6ad149bc81de (patch)
tree40087d71f244ec860436c3e670e5323f356750a8 /gcc/cp/rtti.c
parente607534b43ca5f05409cad81ca1ebc00234851b8 (diff)
downloadgcc-5dae1114bb636a814b154c3c47ff6ad149bc81de.zip
gcc-5dae1114bb636a814b154c3c47ff6ad149bc81de.tar.gz
gcc-5dae1114bb636a814b154c3c47ff6ad149bc81de.tar.bz2
re PR c++/9294 ([new parser] parser enters infinite loop)
PR c++/9294 * cp-tree.def (BASELINK): Make it class 'x', not class 'e'. * cp-tree.h (BASELINK_BINFO): Adjust. (BASELINK_FUNCTIONS): Likewise. (BASELINK_ACCESS_BINFO): Likewise. (tree_baselink): New structure. (cp_tree_node_structure_enum): Add TS_CP_BASELINK. (lang_tree_node): Add baselink. * decl.c (cp_tree_node_structure): Add BASELINK case. * search.c (build_baselink): Adjust. * tree.c (cp_walk_subtrees): Add BASELINK case. Remove BASELINK_P test from TREE_LIST case. PR c++/9272 * parser.c (cp_parser_constructor_declarator_p): Do not assume that a constructor cannot be declared outside of its own class. * parser.c (cp_parser_resolve_typename_type): If the scope cannot be resolved, neither can the qualified name. * rtti.c (get_pseudo_ti_desc): Fix thinko. PR c++/9272 * g++.dg/parse/ctor1.C: New test. PR c++/9294: * g++.dg/parse/qualified1.C: New test. * g++.dg/parse/typename3.C: New test. From-SVN: r61456
Diffstat (limited to 'gcc/cp/rtti.c')
-rw-r--r--gcc/cp/rtti.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 0b68805..e222d25 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -1216,9 +1216,14 @@ get_pseudo_ti_desc (tree type)
if (var_desc)
return var_desc;
- /* Add number of bases and trailing array of
- base_class_type_info. */
- array_domain = build_index_type (size_int (num_bases));
+ /* Create the array of __base_class_type_info entries.
+ G++ 3.2 allocated an array that had one too many
+ entries, and then filled that extra entries with
+ zeros. */
+ if (abi_version_at_least (2))
+ array_domain = build_index_type (size_int (num_bases - 1));
+ else
+ array_domain = build_index_type (size_int (num_bases));
base_array =
build_array_type (base_desc_type_node, array_domain);