]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sem_ch3.adb (Handle_Late_Controlled_Primitive): Add local variable Spec.
authorHristian Kirtchev <kirtchev@adacore.com>
Thu, 6 Feb 2014 10:26:32 +0000 (10:26 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 6 Feb 2014 10:26:32 +0000 (11:26 +0100)
2014-02-06  Hristian Kirtchev  <kirtchev@adacore.com>

* sem_ch3.adb (Handle_Late_Controlled_Primitive): Add local
variable Spec. Do not inherit the null indicator from the
subprogram body when generating the spec.

From-SVN: r207548

gcc/ada/ChangeLog
gcc/ada/sem_ch3.adb

index 463e2689101ea39315d6e8ebb3b8072d2a6037e8..26164ba1f01a45ded8199d827411ed5a46fa008c 100644 (file)
@@ -1,3 +1,9 @@
+2014-02-06  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * sem_ch3.adb (Handle_Late_Controlled_Primitive): Add local
+       variable Spec. Do not inherit the null indicator from the
+       subprogram body when generating the spec.
+
 2014-02-06  Robert Dewar  <dewar@adacore.com>
 
        * casing.adb (Determine_Casing): Consider SPARK_Mode to be
index 2f6eedbb5334785e579b85a2141f5828389a784c..e20f9f10ebbc49ce60cdf65285928ab0cd2c85ed 100644 (file)
@@ -2110,6 +2110,7 @@ package body Sem_Ch3 is
          Loc       : constant Source_Ptr := Sloc (Body_Id);
          Params    : constant List_Id    :=
                        Parameter_Specifications (Body_Spec);
+         Spec      : Node_Id;
          Spec_Id   : Entity_Id;
 
          Dummy : Entity_Id;
@@ -2156,9 +2157,17 @@ package body Sem_Ch3 is
          --  use of Copy_Separate_Tree - we want an entirely separate semantic
          --  tree in this case.
 
+         Spec := Copy_Separate_Tree (Body_Spec);
+
+         --  Ensure that the subprogram declaration does not inherit the null
+         --  indicator from the body as we now have a proper spec and body
+         --  pair.
+
+         Set_Null_Present (Spec, False);
+
          Insert_Before_And_Analyze (Body_Decl,
            Make_Subprogram_Declaration (Loc,
-             Specification => Copy_Separate_Tree (Body_Spec)));
+             Specification => Spec));
       end Handle_Late_Controlled_Primitive;
 
       --------------------------------