diff mbox

[Ada] Internal error on private type with -gnatct

Message ID 201111041126.35217.ebotcazou@adacore.com
State New
Headers show

Commit Message

Eric Botcazou Nov. 4, 2011, 10:26 a.m. UTC
This is an internal error on the type of an argument that isn't elaborated 
early enough in -gnatct mode, because it is the private derivation of a 
private type.  In this mode, the compiler doesn't generate code and gigi is 
invoked only to lay out types and back-annotate type information.

Fixed by lifting the assertion in -gnatct mode, as this corner case doesn't 
seem to warrant a significant change either in gigi or the front-end proper.

Tested on i586-suse-linux, applied on the mainline.


2011-11-04  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Function>: Do not assert
	that the type of the parameters isn't dummy in type_annotate_only mode.


2011-11-04  Eric Botcazou  <ebotcazou@adacore.com>

	* gnat.dg/specs/private1[-sub].ads: New test.
diff mbox

Patch

Index: gcc-interface/decl.c
===================================================================
--- gcc-interface/decl.c	(revision 180818)
+++ gcc-interface/decl.c	(working copy)
@@ -4185,7 +4185,8 @@  gnat_to_gnu_entity (Entity_Id gnat_entit
 	    /* The failure of this assertion will very likely come from an
 	       order of elaboration issue for the type of the parameter.  */
 	    gcc_assert (kind == E_Subprogram_Type
-			|| !TYPE_IS_DUMMY_P (gnu_param_type));
+			|| !TYPE_IS_DUMMY_P (gnu_param_type)
+			|| type_annotate_only);
 
 	    if (gnu_param)
 	      {