diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-04-27 12:55:18 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-04-27 12:55:18 +0000 |
commit | 12760d32ae6c63daa4ff31a261f0ee8aab0f3958 (patch) | |
tree | 3b852b556143ed9a1fe9a1f0c8a1c04e811bffd3 /gcc/ada/sem_ch3.adb | |
parent | 9b29458da8153174e43b7183b2ce4f47f4836a19 (diff) | |
download | gcc-12760d32ae6c63daa4ff31a261f0ee8aab0f3958.tar.gz |
2016-04-27 Bob Duff <duff@adacore.com>
* a-coinve.adb, a-comutr.adb, a-conhel.adb, a-convec.adb,
exp_util.adb: Remove assertions that can fail in obscure cases when
assertions are turned on but tampering checks are turned off.
2016-04-27 Javier Miranda <miranda@adacore.com>
* exp_ch6.adb (Add_Call_By_Copy_Code,
Add_Simple_Call_By_Copy_Code, Expand_Actuals): Handle formals
whose type comes from the limited view.
2016-04-27 Yannick Moy <moy@adacore.com>
* a-textio.adb: Complete previous patch.
2016-04-27 Yannick Moy <moy@adacore.com>
* inline.adb (Expand_Inlined_Call): Use Cannot_Inline instead of
Error_Msg_N to issue message about impossibility to inline call,
with slight change of message.
2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
* exp_spark.adb (Expand_Potential_Renaming): Removed.
(Expand_SPARK): Update the call to expand a potential renaming.
(Expand_SPARK_Potential_Renaming): New routine.
* exp_spark.ads (Expand_SPARK_Potential_Renaming): New routine.
* sem.adb Add with and use clauses for Exp_SPARK.
(Analyze): Expand a non-overloaded potential renaming for SPARK.
2016-04-27 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb (Constrain_Discriminated_Type): In an instance,
check full view for the presence of defaulted discriminants,
even when the partial view of a private type has no visible and
no unknown discriminants.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235497 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r-- | gcc/ada/sem_ch3.adb | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 63704fba139..0d378ec082f 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -13033,7 +13033,7 @@ package body Sem_Ch3 is Related_Nod : Node_Id; For_Access : Boolean := False) is - E : constant Entity_Id := Entity (Subtype_Mark (S)); + E : Entity_Id := Entity (Subtype_Mark (S)); T : Entity_Id; C : Node_Id; Elist : Elist_Id := New_Elmt_List; @@ -13083,15 +13083,22 @@ package body Sem_Ch3 is end if; -- In an instance it may be necessary to retrieve the full view of a - -- type with unknown discriminants. In other contexts the constraint - -- is illegal. + -- type with unknown discriminants, or a full view with defaulted + -- discriminants. In other contexts the constraint is illegal. if In_Instance and then Is_Private_Type (T) - and then Has_Unknown_Discriminants (T) and then Present (Full_View (T)) + and then + (Has_Unknown_Discriminants (T) + or else (not Has_Discriminants (T) + and then Has_Discriminants (Full_View (T)) + and then Present + (Discriminant_Default_Value + (First_Discriminant (Full_View (T)))))) then T := Full_View (T); + E := Full_View (E); end if; -- Ada 2005 (AI-412): Constrained incomplete subtypes are illegal. @@ -20522,14 +20529,14 @@ package body Sem_Ch3 is May_Have_Null_Exclusion : Boolean; - procedure Check_Incomplete (T : Entity_Id); + procedure Check_Incomplete (T : Node_Id); -- Called to verify that an incomplete type is not used prematurely ---------------------- -- Check_Incomplete -- ---------------------- - procedure Check_Incomplete (T : Entity_Id) is + procedure Check_Incomplete (T : Node_Id) is begin -- Ada 2005 (AI-412): Incomplete subtypes are legal |