aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Dismukes <dismukes@adacore.com>2007-10-15 15:56:36 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2007-10-15 15:56:36 +0200
commit0501956d00279d9194fc417293f8601861fcd29a (patch)
tree6b1aac92a54249c4ed30b62b7668bf8b050d2bc8
parent5404d9df9b49fa984f6474dbb96a113974dc2df2 (diff)
downloadgcc-0501956d00279d9194fc417293f8601861fcd29a.zip
gcc-0501956d00279d9194fc417293f8601861fcd29a.tar.gz
gcc-0501956d00279d9194fc417293f8601861fcd29a.tar.bz2
sem_ch3.adb (Build_Derived_Concurrent_Type): Set the Is_Constrained flag of derived concurrent types...
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. From-SVN: r129333
-rw-r--r--gcc/ada/sem_ch3.adb14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index e6d0781..6bddb20 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);