re PR c++/13438 (internal compiler error: tree check: expected identifier_node, have...
authorMark Mitchell <mark@codesourcery.com>
Mon, 22 Dec 2003 08:03:15 +0000 (08:03 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Mon, 22 Dec 2003 08:03:15 +0000 (08:03 +0000)
PR c++/13438
* cp-tree.h (cp_tree_index): Remove CPTI_RECORD_TYPE,
CPTI_UNION_TYPE, CPTI_ENUM_TYPE.
(record_type_node): Remove.
(union_type_node): Likewise.
(enum_type_node): Likewise.
* decl.c: Remove mention of above tree nodes in comment.
* lex.c (cxx_init): Do not assign to record_type_node,
union_type_node, or enum_type_node.  Simplify handling of
class_type_node.

PR c++/13438
* g++.dg/parse/error8.C: New test.

From-SVN: r74931

gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/lex.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/error8.C [new file with mode: 0644]

index 3a70d2e..d667193 100644 (file)
@@ -1,5 +1,15 @@
 2003-12-21  Mark Mitchell  <mark@codesourcery.com>
 
+       * cp-tree.h (cp_tree_index): Remove CPTI_RECORD_TYPE,
+       CPTI_UNION_TYPE, CPTI_ENUM_TYPE.
+       (record_type_node): Remove.
+       (union_type_node): Likewise.
+       (enum_type_node): Likewise.
+       * decl.c: Remove mention of above tree nodes in comment.
+       * lex.c (cxx_init): Do not assign to record_type_node,
+       union_type_node, or enum_type_node.  Simplify handling of
+       class_type_node.
+
        PR c++/11554
        * init.c (sort_mem_initializers): Add warning.
 
index 5c491f0..5dbd102 100644 (file)
@@ -521,9 +521,6 @@ enum cp_tree_index
     CPTI_BASE_DESC_TYPE,
 
     CPTI_CLASS_TYPE,
-    CPTI_RECORD_TYPE,
-    CPTI_UNION_TYPE,
-    CPTI_ENUM_TYPE,
     CPTI_UNKNOWN_TYPE,
     CPTI_VTBL_TYPE,
     CPTI_VTBL_PTR_TYPE,
@@ -602,9 +599,6 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX];
 #define base_desc_type_node            cp_global_trees[CPTI_BASE_DESC_TYPE]
 
 #define class_type_node                        cp_global_trees[CPTI_CLASS_TYPE]
-#define record_type_node               cp_global_trees[CPTI_RECORD_TYPE]
-#define union_type_node                        cp_global_trees[CPTI_UNION_TYPE]
-#define enum_type_node                 cp_global_trees[CPTI_ENUM_TYPE]
 #define unknown_type_node              cp_global_trees[CPTI_UNKNOWN_TYPE]
 #define vtbl_type_node                 cp_global_trees[CPTI_VTBL_TYPE]
 #define vtbl_ptr_type_node             cp_global_trees[CPTI_VTBL_PTR_TYPE]
index 47ad168..c4b9df7 100644 (file)
@@ -140,7 +140,7 @@ tree error_mark_list;
        tree ptm_desc_type_node;
        tree base_desc_type_node;
 
-       tree class_type_node, record_type_node, union_type_node, enum_type_node;
+       tree class_type_node;
        tree unknown_type_node;
 
    Array type `vtable_entry_type[]'
index d1a67b6..b2d2f1c 100644 (file)
@@ -405,21 +405,7 @@ cxx_init (void)
 
   current_function_decl = NULL;
 
-  class_type_node = build_int_2 (class_type, 0);
-  TREE_TYPE (class_type_node) = class_type_node;
-  ridpointers[(int) RID_CLASS] = class_type_node;
-
-  record_type_node = build_int_2 (record_type, 0);
-  TREE_TYPE (record_type_node) = record_type_node;
-  ridpointers[(int) RID_STRUCT] = record_type_node;
-
-  union_type_node = build_int_2 (union_type, 0);
-  TREE_TYPE (union_type_node) = union_type_node;
-  ridpointers[(int) RID_UNION] = union_type_node;
-
-  enum_type_node = build_int_2 (enum_type, 0);
-  TREE_TYPE (enum_type_node) = enum_type_node;
-  ridpointers[(int) RID_ENUM] = enum_type_node;
+  class_type_node = ridpointers[(int) RID_CLASS];
 
   cxx_init_decl_processing ();
 
index 46d665b..d96d8c6 100644 (file)
@@ -1,5 +1,8 @@
 2003-12-21  Mark Mitchell  <mark@codesourcery.com>
 
+       PR c++/13438
+       * g++.dg/parse/error8.C: New test.
+
        PR c++/11554
        * testsuite/g++.dg/warn/ctor-init-1.C: New test.
 
diff --git a/gcc/testsuite/g++.dg/parse/error8.C b/gcc/testsuite/g++.dg/parse/error8.C
new file mode 100644 (file)
index 0000000..125f2e4
--- /dev/null
@@ -0,0 +1,4 @@
+// PR c++/13438
+
+struct A { friend typename struct B; };  // { dg-error "" }
+