diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-27 07:51:59 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-27 07:51:59 +0000 |
commit | cb56012690ae1b8f203a61decdcb5d281db2431c (patch) | |
tree | 58bc341cb04d6000b923fc1d7edb78289d9f2938 /gcc/ada/sem_ch3.adb | |
parent | 84836637fcb8e7c3aea3b25f4cbf17a59cfca553 (diff) | |
download | gcc-cb56012690ae1b8f203a61decdcb5d281db2431c.tar.gz |
2009-07-27 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 150103
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@150104 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r-- | gcc/ada/sem_ch3.adb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 3f1d85c9c8a..b96b9d9ba38 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -2598,12 +2598,20 @@ package body Sem_Ch3 is Check_Unset_Reference (E); - -- If this is a variable, then set current value + -- If this is a variable, then set current value. + -- If this is a declared constant of a scalar type + -- with a static expression, indicate that it is + -- always valid. if not Constant_Present (N) then if Compile_Time_Known_Value (E) then Set_Current_Value (Id, E); end if; + + elsif Is_Scalar_Type (T) + and then Is_OK_Static_Expression (E) + then + Set_Is_Known_Valid (Id); end if; -- Deal with setting of null flags @@ -14547,7 +14555,7 @@ package body Sem_Ch3 is ----------------------- function Is_Null_Extension (T : Entity_Id) return Boolean is - Type_Decl : constant Node_Id := Parent (T); + Type_Decl : constant Node_Id := Parent (Base_Type (T)); Comp_List : Node_Id; Comp : Node_Id; |