From: Zack Weinberg Date: Wed, 7 Jun 2000 22:43:44 +0000 (+0000) Subject: c-decl.c (pushdecl): Do not call COMPLETE_TYPE_P on error_mark_node. X-Git-Tag: prereleases/libstdc++-2.92~5915 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5667abce2904b9b040ffb51d79da04545503bf6c;p=thirdparty%2Fgcc.git c-decl.c (pushdecl): Do not call COMPLETE_TYPE_P on error_mark_node. * c-decl.c (pushdecl): Do not call COMPLETE_TYPE_P on error_mark_node. * print-tree.c (print_node): The transparent_union_flag means different things for unions and arrays. Do not inspect it with TYPE_TRANSPARENT_UNION. From-SVN: r34449 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4aac5bb6f8cc..e129114d1e29 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2000-06-07 Zack Weinberg + + * c-decl.c (pushdecl): Do not call COMPLETE_TYPE_P on + error_mark_node. + * print-tree.c (print_node): The transparent_union_flag means + different things for unions and arrays. Do not inspect it + with TYPE_TRANSPARENT_UNION. + 2000-06-06 Jakub Jelinek * cpplib.c (do_ifdef, do_ifndef): Don't segfault if parse_ifdef diff --git a/gcc/c-decl.c b/gcc/c-decl.c index ba1b3c6a009d..5ee40ba2a5d9 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -2422,8 +2422,12 @@ pushdecl (x) b->shadowed = tree_cons (name, oldlocal, b->shadowed); } - /* Keep count of variables in this level with incomplete type. */ - if (!COMPLETE_TYPE_P (TREE_TYPE (x))) + /* Keep count of variables in this level with incomplete type. + If the input is erroneous, we can have error_mark in the type + slot (e.g. "f(void a, ...)") - that doesn't count as an + incomplete type. */ + if (TREE_TYPE (x) != error_mark_node + && !COMPLETE_TYPE_P (TREE_TYPE (x))) ++b->n_incomplete; } diff --git a/gcc/print-tree.c b/gcc/print-tree.c index ae409e546106..8774538ce3e6 100644 --- a/gcc/print-tree.c +++ b/gcc/print-tree.c @@ -480,8 +480,17 @@ print_node (file, prefix, node, indent) fputs (" string-flag", file); if (TYPE_NEEDS_CONSTRUCTING (node)) fputs (" needs-constructing", file); - if (TYPE_TRANSPARENT_UNION (node)) - fputs (" transparent-union", file); + /* The transparent-union flag is used for different things in + different nodes. */ + if (TYPE_CHECK (node)->type.transparent_union_flag) + { + if (TREE_CODE (node) == UNION_TYPE) + fputs (" transparent-union", file); + else if (TREE_CODE (node) == ARRAY_TYPE) + fputs (" nonaliased-component", file); + else + fputs (" tu-flag", file); + } if (TYPE_PACKED (node)) fputs (" packed", file);