diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-02-06 10:26:32 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-02-06 10:26:32 +0000 |
commit | 489415e266600275895001864764e617458a98ea (patch) | |
tree | af6f8f5446f96536490f9968bc4c7ada168efbf1 /gcc/ada/sem_ch3.adb | |
parent | af3a42766db6d6c7033a23003fa15a40f222027b (diff) | |
download | gcc-489415e266600275895001864764e617458a98ea.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207548 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r-- | gcc/ada/sem_ch3.adb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 2f6eedbb533..e20f9f10ebb 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; -------------------------------- |