aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHristian Kirtchev <kirtchev@adacore.com>2014-02-06 10:26:32 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2014-02-06 11:26:32 +0100
commit79b49b879d3d96c1c7761b2d114dcdfaf7ceaad0 (patch)
treeaf6f8f5446f96536490f9968bc4c7ada168efbf1
parent4446a13faa6ac84d2ef391bfb330370ec78053ca (diff)
downloadgcc-79b49b879d3d96c1c7761b2d114dcdfaf7ceaad0.zip
gcc-79b49b879d3d96c1c7761b2d114dcdfaf7ceaad0.tar.gz
gcc-79b49b879d3d96c1c7761b2d114dcdfaf7ceaad0.tar.bz2
sem_ch3.adb (Handle_Late_Controlled_Primitive): Add local variable Spec.
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
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/sem_ch3.adb11
2 files changed, 16 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 463e268..26164ba 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 2f6eedb..e20f9f1 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -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;
--------------------------------