]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
decl.c (gnat_to_gnu_entity): Do not assert that the type of the parameters isn't...
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 4 Nov 2011 10:27:02 +0000 (10:27 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 4 Nov 2011 10:27:02 +0000 (10:27 +0000)
* 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.

From-SVN: r180931

gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/specs/private1-sub.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/specs/private1.ads [new file with mode: 0644]

index b422f32e1d3d9a995430f209de3633152a7521e6..3c3c4870edaa6966d513a443c300a2b6949d8d76 100644 (file)
@@ -1,3 +1,8 @@
+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  Matthew Heaney  <heaney@adacore.com>
 
        * a-cdlili.ad[sb], a-cidlli.ad[sb], a-coorse.ad[sb], a-ciorse.ad[sb],
index 49434430ecd94ffe3be27929152f56c38f3e81d6..d7ca5dbbe6e28eaf394702e94b0d3b2a1bd57f5b 100644 (file)
@@ -4185,7 +4185,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
            /* 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)
              {
index 24366e971d08f4783d5383d9c3e04e908171b4fe..14f3baba745a839ddb2da4986c397229d6c3faeb 100644 (file)
@@ -1,3 +1,7 @@
+2011-11-04  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gnat.dg/specs/private1[-sub].ads: New test.
+
 2011-11-04  Mikael Morin  <mikael@gcc.gnu.org>
 
        PR fortran/43829
diff --git a/gcc/testsuite/gnat.dg/specs/private1-sub.ads b/gcc/testsuite/gnat.dg/specs/private1-sub.ads
new file mode 100644 (file)
index 0000000..0dcbbd0
--- /dev/null
@@ -0,0 +1,13 @@
+-- { dg-do compile }
+-- { dg-options "-gnatct" }
+
+package Private1.Sub is
+
+   package Nested is
+      type T is limited private;
+      function "=" (X, Y : T) return Boolean;
+   private
+      type T is new Private1.T;
+   end Nested;
+
+end Private1.Sub;
diff --git a/gcc/testsuite/gnat.dg/specs/private1.ads b/gcc/testsuite/gnat.dg/specs/private1.ads
new file mode 100644 (file)
index 0000000..4ef0600
--- /dev/null
@@ -0,0 +1,5 @@
+package Private1 is
+   type T is private;
+private
+   type T is new Boolean;
+end Private1;