Commit 89a01fcf by Eric Botcazou Committed by Eric Botcazou

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
parent d083907f
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> 2015-11-23 Igor Zamyatin <igor.zamyatin@intel.com>
PR c++/68001 PR c++/68001
......
...@@ -2461,7 +2461,8 @@ dump_nested_types (pretty_printer *buffer, tree t, tree parent, bool forward, ...@@ -2461,7 +2461,8 @@ dump_nested_types (pretty_printer *buffer, tree t, tree parent, bool forward,
field = TYPE_FIELDS (outer); field = TYPE_FIELDS (outer);
while (field) 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_CODE (TREE_TYPE (field)) == POINTER_TYPE
&& TREE_TYPE (TREE_TYPE (field)) != outer)) && TREE_TYPE (TREE_TYPE (field)) != outer))
&& (!TYPE_NAME (TREE_TYPE (field)) && (!TYPE_NAME (TREE_TYPE (field))
...@@ -3230,9 +3231,10 @@ print_ada_struct_decl (pretty_printer *buffer, tree node, tree type, int spc, ...@@ -3230,9 +3231,10 @@ print_ada_struct_decl (pretty_printer *buffer, tree node, tree type, int spc,
} }
} }
/* Avoid printing the structure recursively. */ /* Avoid printing the structure recursively. */
else if ((TREE_TYPE (tmp) != node else if (((TREE_TYPE (tmp) != node
|| (TREE_CODE (TREE_TYPE (tmp)) == POINTER_TYPE && TREE_TYPE (tmp) != error_mark_node)
&& TREE_TYPE (TREE_TYPE (tmp)) != node)) || (TREE_CODE (TREE_TYPE (tmp)) == POINTER_TYPE
&& TREE_TYPE (TREE_TYPE (tmp)) != node))
&& TREE_CODE (tmp) != TYPE_DECL && TREE_CODE (tmp) != TYPE_DECL
&& !TREE_STATIC (tmp)) && !TREE_STATIC (tmp))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment