aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorEd Schonberg <schonber@gnat.com>2004-10-27 15:41:55 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2004-10-27 15:41:55 +0200
commitfc4039b93cf1fc1cb12db5cf06b7a9cd3ced2c1a (patch)
tree9b350703f5dc4238ce36ae7101cd8d6a41f16262 /gcc/ada
parentfe98a6aa82871e555908dac1f04225b7d6631db4 (diff)
downloadgcc-fc4039b93cf1fc1cb12db5cf06b7a9cd3ced2c1a.zip
gcc-fc4039b93cf1fc1cb12db5cf06b7a9cd3ced2c1a.tar.gz
gcc-fc4039b93cf1fc1cb12db5cf06b7a9cd3ced2c1a.tar.bz2
sem_ch3.adb (Complete_Private_Subtype): If the full view is a task or protected type with discriminants...
2004-10-26 Ed Schonberg <schonberg@gnat.com> * sem_ch3.adb (Complete_Private_Subtype): If the full view is a task or protected type with discriminants, do not constrain the corresponding record type if the subtype declaration has no discriminant constraints. This can be the case in source code, or in the subtype declaration created to rename an actual type within an instantiation. From-SVN: r89670
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/sem_ch3.adb6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index c48f3b1..fe1cf82 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -7059,9 +7059,15 @@ package body Sem_Ch3 is
Set_Primitive_Operations (Full, Primitive_Operations (Full_Base));
Set_Class_Wide_Type (Full, Class_Wide_Type (Full_Base));
+ -- If this is a subtype of a protected or task type, constrain its
+ -- corresponding record, unless this is a subtype without constraints,
+ -- i.e. a simple renaming as with an actual subtype in an instance.
+
elsif Is_Concurrent_Type (Full_Base) then
if Has_Discriminants (Full)
and then Present (Corresponding_Record_Type (Full_Base))
+ and then
+ not Is_Empty_Elmt_List (Discriminant_Constraint (Full))
then
Set_Corresponding_Record_Type (Full,
Constrain_Corresponding_Record