diff options
author | Robert Dewar <dewar@adacore.com> | 2005-12-09 18:21:28 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2005-12-09 18:21:28 +0100 |
commit | d39d6bb8a0606380752dec6301b06a2af1ed56b2 (patch) | |
tree | c50594c164778cbad2f998e528f1254eddd97e51 | |
parent | 0e0eecec3087d3d639c77814a3ed4b1dc0434cfb (diff) | |
download | gcc-d39d6bb8a0606380752dec6301b06a2af1ed56b2.zip gcc-d39d6bb8a0606380752dec6301b06a2af1ed56b2.tar.gz gcc-d39d6bb8a0606380752dec6301b06a2af1ed56b2.tar.bz2 |
sem_ch6.adb (Analyze_Subprogram_Body): Properly check categorization for case where spec is categorized.
2005-12-05 Robert Dewar <dewar@adacore.com>
* sem_ch6.adb (Analyze_Subprogram_Body): Properly check categorization
for case where spec is categorized.
From-SVN: r108303
-rw-r--r-- | gcc/ada/sem_ch6.adb | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index dae0621..b6c262b 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -955,7 +955,7 @@ package body Sem_Ch6 is end if; else - -- Create a subprogram declaration, to make treatment uniform. + -- Create a subprogram declaration, to make treatment uniform declare Subp : constant Entity_Id := @@ -1449,14 +1449,13 @@ package body Sem_Ch6 is if Present (Spec_Id) then - -- If a parent unit is categorized, the context of a subunit must - -- conform to the categorization. Conversely, if a child unit is - -- categorized, the parents themselves must conform. + -- We must conform to the categorization of our spec - if Nkind (Parent (N)) = N_Subunit then - Validate_Categorization_Dependency (N, Spec_Id); + Validate_Categorization_Dependency (N, Spec_Id); - elsif Is_Child_Unit (Spec_Id) then + -- And if this is a child unit, the parent units must conform + + if Is_Child_Unit (Spec_Id) then Validate_Categorization_Dependency (Unit_Declaration_Node (Spec_Id), Spec_Id); end if; |