aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch3.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2015-05-26 12:35:14 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2015-05-26 12:35:14 +0200
commit8349613899e2e1cf996052e2dba79e0551bfe880 (patch)
tree0a6c5a1eb53a8b2f0eb4b41175119300a72c593e /gcc/ada/sem_ch3.adb
parent596b25f9a110b88d8c7e5fb1fa6cae5819b21691 (diff)
downloadgcc-8349613899e2e1cf996052e2dba79e0551bfe880.zip
gcc-8349613899e2e1cf996052e2dba79e0551bfe880.tar.gz
gcc-8349613899e2e1cf996052e2dba79e0551bfe880.tar.bz2
[multiple changes]
2015-05-26 Doug Rupp <rupp@adacore.com> * init.c [vxworks]: Refine previous checkin. 2015-05-26 Robert Dewar <dewar@adacore.com> * exp_ch4.adb (Wrap_MA): New function. (Expand_N_Op_Expon): Use Wrap_MA. 2015-05-26 Bob Duff <duff@adacore.com> * exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration): Do not use secondary stack to return limited records with defaulted discriminants. This is an efficiency improvement. * exp_ch6.adb, exp_dist.adb, sem_attr.adb, sem_aux.adb, sem_aux.ads, sem_ch12.adb, sem_ch3.adb, sem_ch4.adb, sem_ch6.adb, sem_ch7.adb, sem_util.adb: Change the sense of Is_Indefinite_Subtype to be Is_Definite_Subtype. This is an improvement to readability (the double negative in "not Is_Indefinite_Subtype" was slightly confusing). Also disallow passing non-[sub]type entities, an unnecessary and slightly bug-prone flexibility. From-SVN: r223679
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r--gcc/ada/sem_ch3.adb13
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 54ea442..1940b3b 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -2023,7 +2023,7 @@ package body Sem_Ch3 is
-- The parent type may be a private view with unknown discriminants,
-- and thus unconstrained. Regular components must be constrained.
- if Is_Indefinite_Subtype (T) and then Chars (Id) /= Name_uParent then
+ if not Is_Definite_Subtype (T) and then Chars (Id) /= Name_uParent then
if Is_Class_Wide_Type (T) then
Error_Msg_N
("class-wide subtype with unknown discriminants" &
@@ -3936,7 +3936,7 @@ package body Sem_Ch3 is
-- Case of unconstrained type
- if Is_Indefinite_Subtype (T) then
+ if not Is_Definite_Subtype (T) then
-- In SPARK, a declaration of unconstrained type is allowed
-- only for constants of type string.
@@ -4263,7 +4263,8 @@ package body Sem_Ch3 is
and then Is_Record_Type (T)
and then not Is_Constrained (T)
and then Has_Discriminants (T)
- and then (Ada_Version < Ada_2005 or else Is_Indefinite_Subtype (T))
+ and then (Ada_Version < Ada_2005
+ or else not Is_Definite_Subtype (T))
then
Set_Actual_Subtype (Id, Build_Default_Subtype (T, N));
end if;
@@ -5730,7 +5731,7 @@ package body Sem_Ch3 is
-- that all the indexes are unconstrained but we still need to make sure
-- that the element type is constrained.
- if Is_Indefinite_Subtype (Element_Type) then
+ if not Is_Definite_Subtype (Element_Type) then
Error_Msg_N
("unconstrained element type in array declaration",
Subtype_Indication (Component_Def));
@@ -19568,8 +19569,8 @@ package body Sem_Ch3 is
-- not completed with an unconstrained type. A separate error message
-- is produced if the full type has defaulted discriminants.
- if not Is_Indefinite_Subtype (Priv_T)
- and then Is_Indefinite_Subtype (Full_T)
+ if Is_Definite_Subtype (Priv_T)
+ and then not Is_Definite_Subtype (Full_T)
then
Error_Msg_Sloc := Sloc (Parent (Priv_T));
Error_Msg_NE