summaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-02 15:41:17 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-02 15:41:17 +0000
commit21e9be5d4d6e35432828eb90f4b2e9627c5b274c (patch)
tree14d4af4bcc4645b6d12ca16c261f6082f25cba41 /gcc/ada
parente337be95e6621e643bb95c427d082867610141ae (diff)
downloadgcc-21e9be5d4d6e35432828eb90f4b2e9627c5b274c.tar.gz
2011-12-02 Javier Miranda <miranda@adacore.com>
* sem_ch3.adb (Constrain_Access): Undo previous patch for this routine. Required since the RM rule 3.7.1(7/3) applies to all access types. 2011-12-02 Bob Duff <duff@adacore.com> * sem_ch6.adb: Minor comment fix. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181926 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog10
-rw-r--r--gcc/ada/sem_ch3.adb27
-rw-r--r--gcc/ada/sem_ch6.adb2
3 files changed, 27 insertions, 12 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 924c5544b50..8838582bd22 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,13 @@
+2011-12-02 Javier Miranda <miranda@adacore.com>
+
+ * sem_ch3.adb (Constrain_Access): Undo previous
+ patch for this routine. Required since the RM rule 3.7.1(7/3)
+ applies to all access types.
+
+2011-12-02 Bob Duff <duff@adacore.com>
+
+ * sem_ch6.adb: Minor comment fix.
+
2011-12-02 Joel Sherrill <joel.sherrill@oarcorp.com>
* s-tpopsp-rtems.adb: Use ATCB_Key rather than RTEMS_Ada_Self variable
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 897ed169e85..e7b5327c430 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -10694,18 +10694,24 @@ package body Sem_Ch3 is
return;
end if;
- if Ekind (T) = E_General_Access_Type
+ -- Enforce rule that the constraint is illegal if there is an
+ -- unconstrained view of the designated type. This means that the
+ -- partial view (either a private type declaration or a derivation
+ -- from a private type) has no discriminants. (Defect Report
+ -- 8652/0008, Technical Corrigendum 1, checked by ACATS B371001).
+
+ -- Rule updated for Ada 2005: the private type is said to have
+ -- a constrained partial view, given that objects of the type
+ -- can be declared. Furthermore, the rule applies to all access
+ -- types, unlike the rule concerning default discriminants (see
+ -- RM 3.7.1(7/3))
+
+ if (Ekind (T) = E_General_Access_Type
+ or else Ada_Version >= Ada_2005)
and then Has_Private_Declaration (Desig_Type)
and then In_Open_Scopes (Scope (Desig_Type))
and then Has_Discriminants (Desig_Type)
then
- -- Enforce rule that the constraint is illegal if there is
- -- an unconstrained view of the designated type. This means
- -- that the partial view (either a private type declaration or
- -- a derivation from a private type) has no discriminants.
- -- (Defect Report 8652/0008, Technical Corrigendum 1, checked
- -- by ACATS B371001).
-
declare
Pack : constant Node_Id :=
Unit_Declaration_Node (Scope (Desig_Type));
@@ -10733,9 +10739,8 @@ package body Sem_Ch3 is
then
if No (Discriminant_Specifications (Decl)) then
Error_Msg_N
- ("cannot constrain general access type if " &
- "designated type has constrained partial view",
- S);
+ ("cannot constrain access type if designated " &
+ "type has constrained partial view", S);
end if;
exit;
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index a47a2dc02b6..903950d8f8d 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -8936,7 +8936,7 @@ package body Sem_Ch6 is
Set_Is_Immediately_Visible (E, False);
else
-- Work done in Override_Dispatching_Operation,
- -- so nothing else need to be done here.
+ -- so nothing else needs to be done here.
null;
end if;