re PR c++/68527 (ICE with -fdump-ada-spec on invalid C++ 11 code)
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 26 Nov 2015 12:04:50 +0000 (12:04 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 26 Nov 2015 12:04:50 +0000 (12:04 +0000)
PR c++/68527
* c-ada-spec.c (dump_nested_types): Add guard for error_mark_node.
(print_ada_struct_decl): Likewise.

From-SVN: r230942

gcc/c-family/ChangeLog
gcc/c-family/c-ada-spec.c

index 6e7b0f761f246a1a9e3a38f45788f2c2d557ab65..595fc3a9d6379cfc7abb4b6822a56f61e771b994 100644 (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
index e85c1a9a7d5b2d5ced6ff3fb7d7c5996de52849f..3726a681fa9dad1870fc561ecdd1312db7c9f6f6 100644 (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))
            {