From 3ea9a9382fd8b53498a796d4593cb0c2f35d797b Mon Sep 17 00:00:00 2001 From: charlet Date: Thu, 12 Nov 2015 10:49:07 +0000 Subject: 2015-11-12 Emmanuel Briot * s-os_lib.ads: Documentation update. 2015-11-12 Arnaud Charlet * s-taprop-vxworks.adb, s-osinte-vxworks.ads: Use a single import of taskDelay to avoid confusion. 2015-11-12 Ed Schonberg * exp_ch6.adb (Expand_Simple_Function_Return): If the return type is class-wide and the expression is a view conversion, remove the conversion to prevent overriding of the tag, which must be that of the object being returned. 2015-11-12 Tristan Gingold * bindgen.adb (Gen_Adainit): Code cleanup. 2015-11-12 Hristian Kirtchev * s-stalib.ads: Code cleanup. 2015-11-12 Ed Schonberg * sem_ch3.adb (Analyze_Incomplete_Type_Decl): small optimization. (Analyze_Subtype_Declaration): For floating point types, inherit dimensions. (OK_For_Limited_Init_In_05): Handle properly a conditional expression whose condition is static, and is rewritten as the branch that will be executed. 2015-11-12 Ed Schonberg * sem_attr.adb (Resolve_Attribute, case 'Access): If the context type is an access constant type, do not mark the attribute reference as a possible modification of the prefix. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230226 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/sem_ch3.adb | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'gcc/ada/sem_ch3.adb') diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 881921d5d69..0c01cebb944 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -3043,16 +3043,14 @@ package body Sem_Ch3 is Set_Direct_Primitive_Operations (T, New_Elmt_List); end if; - Push_Scope (T); - Set_Stored_Constraint (T, No_Elist); if Present (Discriminant_Specifications (N)) then + Push_Scope (T); Process_Discriminants (N); + End_Scope; end if; - End_Scope; - -- If the type has discriminants, non-trivial subtypes may be -- declared before the full view of the type. The full views of those -- subtypes will be built after the full view of the type. @@ -4833,6 +4831,7 @@ package body Sem_Ch3 is Set_Scalar_Range (Id, Scalar_Range (T)); Set_Digits_Value (Id, Digits_Value (T)); Set_Is_Constrained (Id, Is_Constrained (T)); + Copy_Dimensions (From => T, To => Id); when Signed_Integer_Kind => Set_Ekind (Id, E_Signed_Integer_Subtype); @@ -18625,6 +18624,16 @@ package body Sem_Ch3 is -- dereference. The function may also be parameterless, in which case -- the source node is just an identifier. + -- A branch of a conditional expression may have been removed if the + -- condition is statically known. This happens during expansion, and + -- thus will not happen if previous errors were encountered. The check + -- will have been performed on the chosen branch, which replaces the + -- original conditional expression. + + if No (Exp) then + return True; + end if; + case Nkind (Original_Node (Exp)) is when N_Aggregate | N_Extension_Aggregate | N_Function_Call | N_Op => return True; -- cgit v1.2.1