re PR c++/68527 (ICE with -fdump-ada-spec on invalid C++ 11 code)

PR c++/68527
	* c-ada-spec.c (dump_nested_types): Add guard for error_mark_node.
	(print_ada_struct_decl): Likewise.

From-SVN: r230942
This commit is contained in:
Eric Botcazou 2015-11-26 12:04:50 +00:00 committed by Eric Botcazou
parent d083907f1f
commit 89a01fcf4c
2 changed files with 12 additions and 4 deletions

View file

@ -1,3 +1,9 @@
2015-11-26 Eric Botcazou <ebotcazou@adacore.com>
PR c++/68527
* c-ada-spec.c (dump_nested_types): Add guard for error_mark_node.
(print_ada_struct_decl): Likewise.
2015-11-23 Igor Zamyatin <igor.zamyatin@intel.com>
PR c++/68001

View file

@ -2461,7 +2461,8 @@ dump_nested_types (pretty_printer *buffer, tree t, tree parent, bool forward,
field = TYPE_FIELDS (outer);
while (field)
{
if ((TREE_TYPE (field) != outer
if (((TREE_TYPE (field) != outer
&& TREE_TYPE (field) != error_mark_node)
|| (TREE_CODE (TREE_TYPE (field)) == POINTER_TYPE
&& TREE_TYPE (TREE_TYPE (field)) != outer))
&& (!TYPE_NAME (TREE_TYPE (field))
@ -3230,9 +3231,10 @@ print_ada_struct_decl (pretty_printer *buffer, tree node, tree type, int spc,
}
}
/* Avoid printing the structure recursively. */
else if ((TREE_TYPE (tmp) != node
|| (TREE_CODE (TREE_TYPE (tmp)) == POINTER_TYPE
&& TREE_TYPE (TREE_TYPE (tmp)) != node))
else if (((TREE_TYPE (tmp) != node
&& TREE_TYPE (tmp) != error_mark_node)
|| (TREE_CODE (TREE_TYPE (tmp)) == POINTER_TYPE
&& TREE_TYPE (TREE_TYPE (tmp)) != node))
&& TREE_CODE (tmp) != TYPE_DECL
&& !TREE_STATIC (tmp))
{