diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-17 05:56:15 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-17 05:56:15 +0000 |
commit | f259ef2dde37cdc1994ab89de4202de11db1758d (patch) | |
tree | fa16d409fa166f36caaced4b9b18b5c11655a10f /gcc/ada/sem_ch3.adb | |
parent | f901aa342fec3c1daf7be7c1f6258571542389b1 (diff) | |
download | gcc-f259ef2dde37cdc1994ab89de4202de11db1758d.tar.gz |
2008-05-17 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r135459
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@135460 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r-- | gcc/ada/sem_ch3.adb | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index d050d1b0505..dd08710e37e 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -6268,8 +6268,8 @@ package body Sem_Ch3 is and then Has_Private_Declaration (Derived_Type) and then Present (Discriminant_Constraint (Derived_Type)) then - -- Verify that constraints of the full view conform to those - -- given in partial view. + -- Verify that constraints of the full view statically match + -- those given in the partial view. declare C1, C2 : Elmt_Id; @@ -6278,9 +6278,18 @@ package body Sem_Ch3 is C1 := First_Elmt (New_Discrs); C2 := First_Elmt (Discriminant_Constraint (Derived_Type)); while Present (C1) and then Present (C2) loop - if not - Fully_Conformant_Expressions (Node (C1), Node (C2)) + + if Fully_Conformant_Expressions (Node (C1), Node (C2)) + or else + (Is_OK_Static_Expression (Node (C1)) + and then + Is_OK_Static_Expression (Node (C2)) + and then + Expr_Value (Node (C1)) = Expr_Value (Node (C2))) then + null; + + else Error_Msg_N ( "constraint not conformant to previous declaration", Node (C1)); |