diff options
| author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-10-15 13:56:36 +0000 |
|---|---|---|
| committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-10-15 13:56:36 +0000 |
| commit | 313dfa5bd2c1e590028a3e89434b0268ef209473 (patch) | |
| tree | 6b1aac92a54249c4ed30b62b7668bf8b050d2bc8 | |
| parent | b737f923378cba2130ff0a94663c984d1d05dd8a (diff) | |
| download | ppe42-gcc-313dfa5bd2c1e590028a3e89434b0268ef209473.tar.gz ppe42-gcc-313dfa5bd2c1e590028a3e89434b0268ef209473.zip | |
2007-10-15 Gary Dismukes <dismukes@adacore.com>
* sem_ch3.adb (Build_Derived_Concurrent_Type): Set the Is_Constrained
flag of derived concurrent types, taking into account the flag setting
on the parent subtype and any new set of discriminants.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@129333 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ada/sem_ch3.adb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index e6d0781df4c..6bddb202db9 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -3855,6 +3855,12 @@ package body Sem_Ch3 is Dont_Care : Boolean; Others_Present : Boolean := False; + pragma Warnings (Off, Case_Table); + pragma Warnings (Off, Last_Choice); + pragma Warnings (Off, Dont_Care); + pragma Warnings (Off, Others_Present); + -- We don't care about the assigned values of any of these + -- Start of processing for Analyze_Variant_Part begin @@ -4573,6 +4579,14 @@ package body Sem_Ch3 is Set_Corresponding_Record_Type (Derived_Type, Corresponding_Record_Type (Parent_Type)); + -- Is_Constrained is set according the parent subtype, but is set to + -- False if the derived type is declared with new discriminants. + + Set_Is_Constrained + (Derived_Type, + (Is_Constrained (Parent_Type) or else Constraint_Present) + and then not Present (Discriminant_Specifications (N))); + if Constraint_Present then if not Has_Discriminants (Parent_Type) then Error_Msg_N ("untagged parent must have discriminants", N); |

