Make_Component_Definition (Loc,
Aliased_Present => False,
Subtype_Indication => New_Occurrence_Of (Ctyp, Loc))),
- Expression => Make_Aggregate (Loc, Expressions => V,
- Is_Enum_Array_Aggregate => True)));
+ Expression => Make_Aggregate (Loc, Expressions => V)));
end Append_Table_To;
-- Start of Build_Enumeration_Image_Tables
Is_Generic_Contract_Pragma,
Is_Homogeneous_Aggregate,
Is_Parenthesis_Aggregate,
- Is_Enum_Array_Aggregate,
Is_Ignored,
Is_Ignored_Ghost_Pragma,
Is_In_Discriminant_Check,
Sy (Null_Record_Present, Flag),
Sy (Is_Parenthesis_Aggregate, Flag),
Sy (Is_Homogeneous_Aggregate, Flag),
- Sy (Is_Enum_Array_Aggregate, Flag),
Sm (Aggregate_Bounds_Or_Ancestor_Type, Node_Id),
Sm (Entity_Or_Associated_Node, Node_Id), -- just Associated_Node
Sm (Compile_Time_Known_Aggregate, Flag),
-- Disable the warning for GNAT Mode to allow for easier transition.
+ -- We don't warn about obsolescent usage of parentheses in generic
+ -- instances for two reasons:
+ --
+ -- 1. An equivalent warning has been emitted in the corresponding
+ -- definition.
+ -- 2. In cases where a generic definition specifies a version older than
+ -- Ada 2022 through a pragma and rightfully uses parentheses for
+ -- an array aggregate, an incorrect warning would be raised in
+ -- instances of that generic that are in Ada 2022 or later if we
+ -- didn't filter out the instance case.
+
if Ada_Version_Explicit >= Ada_2022
and then Warn_On_Obsolescent_Feature
and then not GNAT_Mode
and then not Is_Homogeneous_Aggregate (N)
- and then not Is_Enum_Array_Aggregate (N)
and then Is_Parenthesis_Aggregate (N)
and then Nkind (Parent (N)) /= N_Qualified_Expression
and then Comes_From_Source (N)
+ and then not In_Instance
then
Error_Msg_N
("?j?array aggregate using () is an" &
-- nodes which emulate the barrier function of a protected entry body.
-- The flag is used when checking for incorrect use of Current_Task.
- -- Is_Enum_Array_Aggregate
- -- A flag set on an aggregate created internally while building the
- -- images tables for enumerations.
-
-- Is_Expanded_Build_In_Place_Call
-- This flag is set in an N_Function_Call node to indicate that the extra
-- actuals to support a build-in-place style of call have been added to
-- Compile_Time_Known_Aggregate
-- Expansion_Delayed
-- Has_Self_Reference
- -- Is_Enum_Array_Aggregate
-- Is_Homogeneous_Aggregate
-- Is_Parenthesis_Aggregate
-- plus fields for expression