aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
AgeCommit message (Collapse)AuthorFilesLines
2020-06-10[Ada] Incorrect accessibility checks on functions callsJustin Squirek6-184/+203
2020-06-10 Justin Squirek <squirek@adacore.com> gcc/ada/ * exp_ch3.adb (Expand_N_Object_Declaration): Add condition to handle processing of objects initialized by a call to a function return an anonymous access type. * exp_ch6.adb, exp_ch6.ads (Has_Unconstrained_Access_Discriminants): Moved to sem_util.adb (Needs_Result_Accessibility_Level): Moved to sem_util.adb * sem_util.adb, sem_util.ads (Has_Unconstrained_Access_Discriminants): Moved from exp_ch6.adb (Needs_Result_Accessibility_Level): Moved from exp_ch6.adb * sem_res.adb (Valid_Conversion): Add condition for the special case where the operand of a conversion is the result of an anonymous access type
2020-06-10[Ada] Reject illegal bodies for null proceduresGhjuvan Lacambre1-0/+7
2020-06-10 Ghjuvan Lacambre <lacambre@adacore.com> gcc/ada/ * par-ch6.adb (P_Subprogram): Reject duplicate subprogram declarations.
2020-06-10[Ada] Fix incorrect insertion of post-call actions in if-expressionEric Botcazou1-5/+10
2020-06-10 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * exp_ch6.adb (Insert_Post_Call_Actions): Deal with the context of an if-expression and with a call written in prefixed notation.
2020-06-10[Ada] Minor reformatting and some typo fixesGary Dismukes4-14/+14
2020-06-10 Gary Dismukes <dismukes@adacore.com> gcc/ada/ * einfo.ads: Minor reformatting of a comment. * exp_aggr.adb: Minor reformatting and a grammar correction. * exp_attr.adb: Minor reformatting and a typo fix in some comments. * sem_ch12.adb: Fix three typos in comments.
2020-06-10Daily bump.GCC Administrator1-0/+278
2020-06-09[Ada] Missing check on private overriding of dispatching primitiveJavier Miranda5-12/+47
2020-06-09 Javier Miranda <miranda@adacore.com> gcc/ada/ * sem_ch6.adb (New_Overloaded_Entity): Add missing call to check subtype conformance of overriding dispatching primitive. * sem_eval.adb (Subtypes_Statically_Match): Handle derivations of private subtypes. * libgnat/g-exptty.adb, libgnat/g-exptty.ads (Set_Up_Communications): Fix the profile since null-exclusion is missing in the access type formals. * sem_disp.ads (Check_Operation_From_Private_View): Adding documentation.
2020-06-09[Ada] Small enhancement in XEinfo utilityEric Botcazou2-16/+44
2020-06-09 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * einfo.ads (XEINFO section): Update format description. (Is_Subprogram_Or_Entry): Move pragma to regular section. (Is_Subprogram_Or_Generic_Subprogram): Likewise. * xeinfo.adb (Get_B4): Rename to... (Get_B0): ...this. (Translate_Expr): New procedure extracted from... (XEinfo): ...here. Try to apply Get_B0 first and then call Translate_Expr to translate supported constructs.
2020-06-09[Ada] Implement AI12-0028: Import of variadic C functionsEric Botcazou10-107/+278
2020-06-09 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * exp_ch6.adb (Freeze_Subprogram): Deal with convention C_Family. * freeze.adb (Freeze_Profile): Likewise. Add missing guard. * sem_mech.adb (Set_Mechanisms): Likewise. * lib-xref.adb (Output_Import_Export_Info): Ditto for C_Variadic. * repinfo.adb (List_Subprogram_Info): Likewise. * sem_prag.adb (Set_Convention_From_Pragma): Move main checks for Stdcall to... (Process_Convention): ...here. Add checks for C_Variadic. * snames.ads-tmpl: Add Name_C_Variadic_0 .. Name_C_Variadic_16. Use consistent format for subtype declarations. (Convention_Id): Add Convention_C_Variadic_0 .. C_Variadic_16 and move Convention_CPP up. (Convention_C_Family): New subtype of Convention_Id. (Convention_C_Variadic): Likewise. (Foreign_Convention): Use explicit upper bound. Add pragma Inline for Is_Configuration_Pragma_Name, Is_Function_Attribute_Name, Is_Internal_Attribute_Name and Is_Procedure_Attribute_Name. * snames.adb-tmpl (Get_Convention_Id): Deal with Name_Variadic_n. (Get_Convention_Name): Deal with Convention_Variadic_n. * types.h (Convention_Id): New typedef. * xsnamest.adb (Name2): New variable. (Is_Conv): New pattern. (Get_Subt1): Likewise. (Get_Subt2): Likewise. Output subtypes of Convention_Id into the C header file.
2020-06-09[Ada] Code clean ups and comments updatesArnaud Charlet6-4/+17
2020-06-09 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * exp_ch3.adb, exp_ch4.adb, exp_ch6.adb, exp_ch9.adb, exp_disp.adb, exp_util.adb: Add comments related to errors that should be moved to semantic analysis. Also replace "?" with "??" in warning messages.
2020-06-09[Ada] Improve handling of null unbounded stringsArnaud Charlet2-42/+13
2020-06-09 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * libgnat/a-strunb__shared.ads, libgnat/a-strunb__shared.adb (Reference, Unreference): No-op for Empty_Shared_String. Remove unneeded calls to Reference.
2020-06-09[Ada] Remove kludge for AI05-0087Arnaud Charlet2-41/+14
2020-06-09 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * exp_ch5.adb (Expand_N_Assignment): Remove kludge for AI05-0087. * sem_ch12.adb (Validate_Derived_Type_Instance): Implement AI05-0087 retroactively since it's a binding interpretation.
2020-06-09[Ada] Small cleanup in Einfo unitEric Botcazou2-114/+173
2020-06-09 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * einfo.ads (Has_Foreign_Convention): Fix description. (Component_Alignment): Move around. (Has_DIC): Likewise. (Has_Interrupt_Handler): Likewise. (Has_Invariants): Likewise. (Is_Atomic_Or_VFA): Likewise. (Next_Index): Likewise. (Scope_Depth): Likewise. (Init_Component_Size): Likewise. (Init_Component_Location): Likewise. (Init_Size): Likewise. (Inline Pragmas for functions): Add Corresponding_Function, Corresponding_Procedure, Entry_Max_Queue_Lengths_Array, Finalize_Storage_Only, Has_DIC, Has_Invariants, Initialization_Statements, Is_Anonymous_Access_Type, Next_Stored_Discriminant, Address_Clause, Alignment_Clause, Float_Rep, Has_Foreign_Convention, Has_Non_Limited_View, Is_Constant_Object, Is_Discriminal, Is_Finalizer, Is_Null_State, Is_Prival, Is_Protected_Component, Is_Protected_Record_Type, Is_Subprogram_Or_Entry, Is_Task_Record_Type, Size_Clause, Stream_Size_Clause, Type_High_Bound, Type_Low_Bound, Known_*, Unknown_*. (Inline Pragmas for procedures): Add Set_Corresponding_Function, Set_Corresponding_Procedure, Set_Finalize_Storage_Only, Set_Float_Rep, Set_Initialization_Statements, Init_Normalized_First_Bit, Init_Normalized_Position, Init_Normalized_Position_Max. * einfo.adb (Was_Hidden): Move around. (Is_Packed_Array): Likewise. (Model_Emin_Value): Likewise. (Model_Epsilon_Value): Likewise. (Model_Mantissa_Value): Likewise. (Model_Small_Value): Likewise.
2020-06-09[Ada] Ada2020 AI12-0282: Shared variable control aspects in genericsEd Schonberg1-2/+21
2020-06-09 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_ch12.adb (Check_Shared_Variable_Control_Aspects): Require exact match between formal and actual for aspects Atomic and Volatile only for formal derived types.
2020-06-09[Ada] Improve handling of aggregates in Side_Effect_FreeArnaud Charlet1-0/+6
2020-06-09 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * exp_util.adb (Side_Effect_Free): Improve handling of N_Aggregate.
2020-06-09[Ada] Fix wrong type being used for range check generationGhjuvan Lacambre1-2/+4
2020-06-09 Ghjuvan Lacambre <lacambre@adacore.com> gcc/ada/ * sem_res.adb (Resolve_Qualified_Expression): Use Subtype_Mark type.
2020-06-09[Ada] Expand more others aggregates staticallyArnaud Charlet1-58/+57
2020-06-09 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * exp_aggr.adb (Max_Aggregate_Size): New function to factorize code. (Convert_To_Positional, Aggr_Size_OK): Use Max_Aggregate_Size.
2020-06-09[Ada] Code refactoring on calls to Set_Debug_Info_NeededArnaud Charlet4-7/+17
2020-06-09 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * sem_util.ads, sem_util.adb (Set_Debug_Info_Defining_Id): New. * exp_ch3.adb, exp_ch8.adb: Call Set_Debug_Info_Defining_Id when relevant.
2020-06-09[Ada] Missing documentation for Returns_By_RefJustin Squirek1-3/+5
2020-06-09 Justin Squirek <squirek@adacore.com> gcc/ada/ * einfo.ads (Returns_By_Ref): Modify documentation to reflect that Returns_By_Ref can be applied to E_Subprogram_Type entities.
2020-06-09[Ada] Spurious overlap error on zero-sized arrays with -gnateVJustin Squirek1-27/+64
2020-06-09 Justin Squirek <squirek@adacore.com> gcc/ada/ * exp_attr.adb (Expand_N_Attribute_Reference): Modify expansion of 'Overlaps_Storage to take into account zero sized arrays.
2020-06-09[Ada] Write_Invocation_Graph_Vertex: include lib item nameBob Duff9-1420/+1415
2020-06-09 Bob Duff <duff@adacore.com> gcc/ada/ * bindo-graphs.adb, bindo-graphs.ads: For each invocation graph, record the corresponding library graph. * bindo-writers.adb (Write_Invocation_Graph_Vertex): Print the lib item name. Remove library graph parameters. * bindo-augmentors.adb, bindo-augmentors.ads, bindo-builders.adb, bindo-diagnostics.adb, bindo-diagnostics.ads, bindo-elaborators.adb: Remove library graph parameters.
2020-06-09[Ada] Propagate DIC, Invariant and Predicate attributes to viewsEric Botcazou9-120/+230
2020-06-09 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * checks.adb (Apply_Predicate_Check): Extend trick used for aggregates to qualified aggregates and object declarations * einfo.ads (Has_Own_DIC): Mention the underlying full view. (Has_Own_Invariants): Likewise. (Has_Predicates): Likewise. * exp_util.adb (Build_DIC_Procedure_Declaration): Do not deal with base types explicitly but with underlying full views. (Build_Invariant_Procedure_Declaration): Likewise. * sem_ch13.adb (Build_Predicate_Functions): Do not deal with the full view manually but call Propagate_Predicate_Attributes to propagate attributes to views. (Build_Predicate_Function_Declaration): Likewise. * sem_ch3.adb (Build_Assertion_Bodies_For_Type): Build bodies for private full views with an underlying full view. (Build_Derived_Private_Type): Small comment tweak. (Complete_Private_Subtype): Call Propagate_Predicate_Attributes. (Process_Full_View): Do not deal with base types explicitly for DIC and Invariant attributes. Deal with underlying full views for them. Call Propagate_Predicate_Attributes and deal with underlying full views for them. * sem_ch7.adb (Preserve_Full_Attributes): Do not cross propagate DIC and Invariant attributes between full type and its base type. Propagate Predicate attributes from the full to the private view. * sem_ch9.adb (Analyze_Protected_Type_Declaration): Likewise. (Analyze_Task_Type_Declaration): Likewise. * sem_util.ads (Get_Views): Remove Full_Base parameter and add UFull_Typ parameter. (Propagate_Predicate_Attributes): New procedure. * sem_util.adb (Get_Views): Remove Full_Base parameter and add UFull_Typ parameter. Retrieve the Corresponding_Record_Type from the underlying full view, if any. (Propagate_DIC_Attributes): Remove useless tests. (Propagate_Invariant_Attributes): Likewise. (Propagate_Predicate_Attributes): New procedure.
2020-06-09[Ada] Crash on exit statement within predicated loopJustin Squirek1-8/+16
2020-06-09 Justin Squirek <squirek@adacore.com> gcc/ada/ * exp_ch5.adb (Expand_Predicated_Loop): Perserve the original loop identifier within the expansion.
2020-06-09[Ada] gnatbind: Correct assertions in Add_Edge_Kind_CheckBob Duff2-42/+41
2020-06-09 Bob Duff <duff@adacore.com> gcc/ada/ * bindo-graphs.ads (Library_Graph_Edge_Kind): Reorder enumerals to reflect the order of adding edges. Clarify comments. * bindo-graphs.adb (Add_Edge_Kind_Check): Correct the assertions. Reorder the "when"s to match the order of adding edges, and therefore the order of enumerals in type Library_Graph_Edge_Kind. Change names to "Old_" and "New_" to clarify what's what. Combine Invocation_Edge into the "<=" test. Fix the "raise Program_Error" message, which was backwards.
2020-06-09[Ada] Add debugging messageBob Duff1-1/+1
2020-06-09 Bob Duff <duff@adacore.com> gcc/ada/ * bindo-graphs.adb (Add_Edge_Kind_Check): Add the Image of the old and new Kinds to the raise Program_Error message.
2020-06-09[Ada] Remove bypass for instance bodies from Is_Visible_ComponentEric Botcazou1-33/+0
2020-06-09 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * sem_ch3.adb (Is_Visible_Component): Do not special-case bodies of instances.
2020-06-09[Ada] Membership test against a non-excluding subtypeArnaud Charlet1-33/+36
2020-06-09 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * exp_ch4.adb (Expand_N_In): Fix handling of null exclusion.
2020-06-09[Ada] Ada2020 AI12-0282: Shared variable control aspects in genericsEd Schonberg1-37/+39
2020-06-09 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_ch12.adb (Check_Shared_Variable_Control_Aspects): Require exact match between formal and actual for aspects Atomic, Atomic_Component, Volatile, and Volatile_Components.
2020-06-09[Ada] gnatpp: documentation for --no-separate-return switchBob Duff1-0/+8
2020-06-09 Bob Duff <duff@adacore.com> gcc/ada/ * doc/gnat_ugn/gnat_utility_programs.rst: Add documentation for the --no-separate-return switch of gnatpp.
2020-06-09[Ada] Add missing tag with -gnatw.dArnaud Charlet1-2/+2
2020-06-09 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * sem_warn.adb (Warn_On_Constant_Valid_Condition): Add proper warning tag.
2020-06-09[Ada] Refine implementation of AI05-0149 missing conversion checksArnaud Charlet2-6/+8
2020-06-09 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * sem_type.adb (Covers): Fix implementation of AI05-0149. * sem_res.adb: Fix typo.
2020-06-09[Ada] Spurious error on instantiations with Taft_Amendment types and tasksEd Schonberg1-1/+4
2020-06-09 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * exp_ch9.adb (Build_Master_Renaming): Make name in renaming declaration unique by adding a numeric suffix, to prevent accidental name conflict when several instantiations of a package containing an access_to_incomplete type that designate tasks appear in the same scope.
2020-06-09[Ada] Annotate Ada.Synchronous_Barriers with SPARK_Mode => OffPiotr Trojanek4-4/+4
2020-06-09 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * libgnarl/a-synbar.ads, libgnarl/a-synbar.adb, libgnarl/a-synbar__posix.ads, libgnarl/a-synbar__posix.adb (Ada.Synchronous_Barriers): Annotate with SPARK_Mode => Off.
2020-06-09[Ada] AI1-0201 Relational operators of static string types are now staticArnaud Charlet1-15/+37
2020-06-09 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * sem_eval.adb (Eval_Relational_Op, Eval_String_Literal, Eval_Type_Conversion): Relax rules on relational operators and type conversions of static string types.
2020-06-09[Ada] Ada2020: AI12-0301 Predicates and Default_ValueArnaud Charlet3-6/+10
2020-06-09 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * sem_util.ads, sem_util.adb (Is_Partially_Initialized_Type): Take Default_Value and Default_Component_Value into account. * sem_ch3.adb (Analyze_Object_Declaration): Update comment.
2020-06-09[Ada] Disable assertion regarding Body_Before_Spec_EdgeBob Duff1-1/+6
2020-06-09 Bob Duff <duff@adacore.com> gcc/ada/ * bindo-graphs.adb (Add_Edge_Kind_Check): Disable failing part of the assertion.
2020-06-09Daily bump.GCC Administrator1-0/+302
2020-06-08[Ada] Implement AI12-0073 (Ravenscar disallows Synchronous_Barriers)Steve Baird1-5/+26
2020-06-08 Steve Baird <baird@adacore.com> gcc/ada/ * sem_prag.adb (Analyze_Pragma.Set_Ravenscar_Profile): Add appropriate call to Set_Restriction_No_Dependence if Ada_Version >= Ada2012 and Profile is either Ravenscar or a GNAT-defined Ravenscar variant (i.e., not Jorvik).
2020-06-08[Ada] AI12-0204 Renaming of a prefixed viewArnaud Charlet2-2/+18
2020-06-08 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * sem_ch5.adb: Fix typo. * sem_ch8.adb (Analyze_Renamed_Primitive_Operation): Check that the prefix of a prefixed view must be renamable as an object.
2020-06-08[Ada] AI12-0085 Missing aspect cases for Remote_TypesArnaud Charlet5-8/+31
2020-06-08 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * sem_cat.ads: Fix typo. * sem_cat.adb (Validate_Remote_Access_To_Class_Wide_Type): Add handling of N_Attribute_Definition_Clause. * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Call Validate_Remote_Access_To_Class_Wide_Type for Storage_Size and Storage_Pool. * sem_attr.adb, exp_ch4.adb: Update comments.
2020-06-08[Ada] Spurious error on call to controlled primitiveJustin Squirek1-3/+4
2020-06-08 Justin Squirek <squirek@adacore.com> gcc/ada/ * sem_ch4.adb (Analyze_One_Call): Add extra condition to the predicate for deciding when a given controlled call is visible.
2020-06-08[Ada] Port a modified expansion of Enum_Rep from GNAT to GNATprovePiotr Trojanek1-10/+3
2020-06-08 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Port changes in frontend expander.
2020-06-08[Ada] Style cleanups in new code for Pure_BarriersPiotr Trojanek1-3/+5
2020-06-08 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * sem_ch13.adb (All_Membership_Choices_Static): Fix style.
2020-06-08[Ada] Implement AI12-0291 (Jorvik profile)Steve Baird4-4/+82
2020-06-08 Steve Baird <baird@adacore.com> gcc/ada/ * libgnat/s-rident.ads: Add Jorvik to the Profile_Name enumeration type. Add an element for Jorvik to the array aggregate that is the initial value of the constant Profile_Info. * targparm.adb (Get_Target_Parameters): Handle "pragma Profile (Jorvik);" similarly to "pragma Profile (Ravenscar);". * snames.ads-tmpl: Declare Name_Jorvik Name_Id. Unlike Ravenscar, Jorvik is not a pragma name and has no corresponding element in the Pragma_Id enumeration type; this means that its declaration must not occur between those of First_Pragma_Name and Last_Pragma_Name. * sem_prag.adb (Analyze_Pragma): Add call to Set_Ravenscar_Profile for Jorvik, similar to the existing calls for Ravenscar and the GNAT Ravenscar variants.
2020-06-08[Ada] AI12-0228 Properties of qualified expressions used as namesArnaud Charlet2-16/+32
2020-06-08 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * sem_ch8.adb (Analyze_Object_Renaming): Update Get_Object_Name to go through N_Qualified_Expression and N_Type_Conversion. Fix another case of wrong usage of E_Anonymous_Access_Type instead of Anonymous_Access_Kind. * sem_util.adb (Is_Dependent_Component_Of_Mutable_Object): Work on the original node. (Is_Aliased_View): Take into account N_Qualified_Expression.
2020-06-08[Ada] Fix handling of 'Enum_Rep and renamingsArnaud Charlet2-17/+6
2020-06-08 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * sem_eval.adb (Eval_Type_Conversion): Fix handling of enumeration to integer conversions. * exp_attr.adb (Expand_N_Attribute_Reference [Attribute_Enum_Rep]): Remove special casing for first-level renaming, best left to the general folding mechanism via Eval_Type_Conversion.
2020-06-08[Ada] Remove the Has_Dynamic_Range_Check flagEric Botcazou9-150/+28
2020-06-08 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * atree.adb (New_Copy): Do not clear Has_Dynamic_Range_Check. * checks.ads (Append_Range_Checks): Remove Flag_Node parameter. (Insert_Range_Checks): Likewise and remove default value of Static_Loc parameter. * checks.adb (Append_Range_Checks): Remove Flag_Node parameter. Do not test and set Has_Dynamic_Range_Check. (Insert_Range_Checks): Likewise and remove default value of Static_Loc parameter. * csinfo.adb (CSinfo): Remove 'L' from [NEUB]_Fields pattern and do not handle Has_Dynamic_Range_Check. * exp_ch5.adb (Expand_N_Assignment_Statement): Remove argument in call to Insert_Range_Checks. * sem_ch3.adb (Analyze_Subtype_Declaration): Do not fiddle with Has_Dynamic_Range_Check. (Process_Range_Expr_In_Decl): Remove argument in calls to Insert_Range_Checks and Append_Range_Checks. * sinfo.ads (Has_Dynamic_Range_Check): Delete. (Set_Has_Dynamic_Range_Check): Likewise. * sinfo.adb (Has_Dynamic_Range_Check): Delete. (Set_Has_Dynamic_Range_Check): Likewise. * treepr.adb (Print_Node): Do not print Has_Dynamic_Range_Check.
2020-06-08[Ada] Implement AI12-0290 (Simple_Barriers restriction)Steve Baird3-68/+106
2020-06-08 Steve Baird <baird@adacore.com> gcc/ada/ * sem_ch13.ads: Export new function All_Membership_Choices_Static. * sem_ch13.adb: Implement new function All_Membership_Choices_Static. This involves moving the functions Is_Static_Choice and All_Membership_Choices_Static, which were previously declared within the function Is_Predicate_Static, out to library level so that they can be called by the new function. The already-exisiting code in Is_Predicate_Static which became the body of All_Membership_Choices_Static is replaced with a call to the new function in order to avoid duplication. * exp_ch9.adb (Is_Pure_Barrier): Several changes needed to implement rules of AI12-0290 and RM D.7's definition of "pure-barrier-eligible". These changes include adding a call to the new function Sem_13.All_Membership_Choices_Static, as per the "see 4.9" in RM D.7(1.6/5).
2020-06-08[Ada] Issue with unnesting of 'First/Last and renamingRichard Kenner1-11/+16
2020-06-08 Richard Kenner <kenner@adacore.com> gcc/ada/ * exp_unst.adb (Visit_Node): When visiting array attribute nodes, in addition to checking the type of Get_Referenced_Object of the prefix, also check the actual type of the prefix.
2020-06-08[Ada] Implement predicate checks on qualified expressions (AI12-0100)Gary Dismukes5-40/+61
2020-06-08 Gary Dismukes <dismukes@adacore.com> gcc/ada/ * checks.adb (Apply_Predicate_Check): Refine test for being in a subprogram body to account for no Corresponding_Body case, avoiding blowups arising due to other changes here. * exp_ch4.adb (Expand_N_Qualified_Expression): Apply predicate checks, if any, after constraint checks are applied. * sem_eval.ads (Check_Expression_Against_Static_Predicate): Add Check_Failure_Is_Error formal for conditionalizing warning vs. error messages. * sem_eval.adb (Check_Expression_Against_Static_Predicate): Issue an error message rather than a warning when the new Check_Failure_Is_Error formal is True. In the nonstatic or Dynamic_Predicate case where the predicate is known to fail, emit the check to ensure that folded cases get checks applied. * sem_res.adb (Resolve_Qualified_Expression): Call Check_Expression_Against_Static_Predicate, passing True for Check_Failure_Is_Error, to ensure we reject static predicate violations. Remove code that was conditionally calling Apply_Predicate_Check, which is no longer needed, and that check procedure shouldn't be called from a resolution routine in any case. Also remove associated comment about preventing infinite recursion and consistency with Resolve_Type_Conversion, since that handling was already similarly removed from Resolve_Type_Convesion at some point. (Resolve_Type_Conversion): Add passing of True for Check_Failure_Is_Error parameter on call to Check_Expression_Against_Static_Predicate, to ensure that static conversion cases that violate a predicate are rejected as errors.
2020-06-08[Ada] Restore Snames.Name_SPARK as it used in the GNATprove backendPiotr Trojanek1-0/+1
2020-06-08 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * snames.ads-tmpl (Name_SPARK): Restore after being deleted.