decl.c (gnat_to_gnu_entity): Deal with an error mark as renamed object in type annota...
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 18 Nov 2013 09:50:25 +0000 (09:50 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 18 Nov 2013 09:50:25 +0000 (09:50 +0000)
* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Deal with an
error mark as renamed object in type annotating mode.

From-SVN: r204942

gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c

index 4de8e32..86000b1 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-18  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Deal with an
+       error mark as renamed object in type annotating mode.
+
 2013-11-15  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR ada/54040
index d386602..d3cc546 100644 (file)
@@ -1117,8 +1117,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
                           as we have a VAR_DECL for the pointer we make.  */
                      }
 
-                   gnu_expr = build_unary_op (ADDR_EXPR, gnu_type,
-                                              maybe_stable_expr);
+                   if (type_annotate_only
+                       && TREE_CODE (maybe_stable_expr) == ERROR_MARK)
+                     gnu_expr = NULL_TREE;
+                   else
+                     gnu_expr = build_unary_op (ADDR_EXPR, gnu_type,
+                                                maybe_stable_expr);
 
                    gnu_size = NULL_TREE;
                    used_by_ref = true;