-- subtypes. Contains the Digits value specified in the declaration.
-- Direct_Primitive_Operations
--- Defined in tagged types and subtypes (including synchronized types),
--- in tagged private types, and in tagged incomplete types. Moreover, it
--- is also defined for untagged types, both when Extensions_Allowed is
--- True (-gnatX) to support the extension feature of prefixed calls for
--- untagged types, and when Extensions_Allowed is False to get better
--- error messages. This field is an element list of entities for
--- primitive operations of the type. For incomplete types the list is
--- always empty. In order to follow the C++ ABI, entities of primitives
--- that come from source must be stored in this list in the order of
--- their occurrence in the sources. When expansion is disabled, the
--- corresponding record type of a synchronized type is not constructed.
--- In that case, such types carry this attribute directly.
+-- Defined in concurrent types, tagged record types and subtypes, tagged
+-- private types, and tagged incomplete types. Moreover, it is also
+-- defined in untagged types, both when GNAT extensions are allowed, to
+-- support prefixed calls for untagged types, and when GNAT extensions
+-- are not allowed, to give better error messages. Set to a list of
+-- entities for primitive operations of the type. For incomplete types
+-- the list is always empty. In order to follow the C++ ABI, entities of
+-- primitives that come from source must be stored in this list in the
+-- order of their occurrence in the sources. When expansion is disabled,
+-- the corresponding record type of concurrent types is not constructed;
+-- in this case, such types carry this attribute directly.
-- Directly_Designated_Type
-- Defined in access types. This field points to the type that is
-- Primitive_Operations (synthesized)
-- Defined in concurrent types, tagged record types and subtypes, tagged
--- private types and tagged incomplete types. For concurrent types whose
--- Corresponding_Record_Type (CRT) is available, returns the list of
--- Direct_Primitive_Operations of its CRT; otherwise returns No_Elist.
--- For all the other types returns the Direct_Primitive_Operations.
+-- private types, and tagged incomplete types. Moreover, it is also
+-- defined in untagged types, both when GNAT extensions are allowed, to
+-- support prefixed calls for untagged types, and when GNAT extensions
+-- are not allowed, to give better error messages. For concurrent types
+-- whose Corresponding_Record_Type (CRT) is available, returns the list
+-- of Direct_Primitive_Operations of this CRT. In all the other cases,
+-- returns the list of Direct_Primitive_Operations.
-- Prival
-- Defined in private components of protected types. Refers to the entity
-- Initialize the list of primitive operations to an empty list,
-- to cover tagged types as well as untagged types. For untagged
-- types this is used either to analyze the call as legal when
- -- Core_Extensions_Allowed is True, or to issue a better error message
- -- otherwise.
+ -- GNAT extensions are allowed, or to give better error messages.
Set_Direct_Primitive_Operations (T, New_Elmt_List);
Set_No_Tagged_Streams_Pragma
(Id, No_Tagged_Streams_Pragma (T));
Set_Is_Abstract_Type (Id, Is_Abstract_Type (T));
- Set_Direct_Primitive_Operations
- (Id, Direct_Primitive_Operations (T));
Set_Class_Wide_Type (Id, Class_Wide_Type (T));
if Is_Interface (T) then
No_Tagged_Streams_Pragma (T));
Set_Is_Abstract_Type (Id, Is_Abstract_Type (T));
Set_Class_Wide_Type (Id, Class_Wide_Type (T));
- Set_Direct_Primitive_Operations (Id,
- Direct_Primitive_Operations (T));
end if;
-- In general the attributes of the subtype of a private type
(Id, No_Tagged_Streams_Pragma (T));
end if;
- -- For tagged types, or when prefixed-call syntax is allowed
- -- for untagged types, initialize the list of primitive
- -- operations to an empty list.
-
- if Is_Tagged_Type (Id)
- or else Core_Extensions_Allowed
- then
- Set_Direct_Primitive_Operations (Id, New_Elmt_List);
- end if;
-
-- Ada 2005 (AI-412): Decorate an incomplete subtype of an
-- incomplete type visible through a limited with clause.
-- When prefixed calls are enabled for untagged types, the subtype
-- shares the primitive operations of its base type. Do this even
- -- when Extensions_Allowed is False to issue better error messages.
+ -- when GNAT extensions are not allowed, in order to give better
+ -- error messages.
Set_Direct_Primitive_Operations
(Id, Direct_Primitive_Operations (Base_Type (T)));
-- Initialize the list of primitive operations to an empty list,
-- to cover tagged types as well as untagged types. For untagged
-- types this is used either to analyze the call as legal when
- -- Extensions_Allowed is True, or to issue a better error message
- -- otherwise.
+ -- GNAT extensions are allowed, or to give better error messages.
Set_Direct_Primitive_Operations (Derived_Type, New_Elmt_List);
-- Initialize the list of primitive operations to an empty list,
-- to cover tagged types as well as untagged types. For untagged
-- types this is used either to analyze the call as legal when
- -- Extensions_Allowed is True, or to issue a better error message
- -- otherwise.
+ -- GNAT extensions are allowed, or to give better error messages.
Set_Direct_Primitive_Operations (Derived_Type, New_Elmt_List);
Make_Class_Wide_Type (Def_Id);
end if;
+ -- When prefixed calls are enabled for untagged types, the subtype
+ -- shares the primitive operations of its base type. Do this even
+ -- when GNAT extensions are not allowed, in order to give better
+ -- error messages.
+
+ Set_Direct_Primitive_Operations
+ (Def_Id, Direct_Primitive_Operations (T));
+
Set_Stored_Constraint (Def_Id, No_Elist);
if Has_Discrs then
if Is_Tagged_Type (T) then
-- Ada 2005 (AI-251): In case of concurrent types we inherit the
- -- concurrent record type (which has the list of primitive
- -- operations).
+ -- concurrent record type.
- if Ada_Version >= Ada_2005
- and then Is_Concurrent_Type (T)
- then
- Set_Corresponding_Record_Type (Def_Id,
- Corresponding_Record_Type (T));
- else
- Set_Direct_Primitive_Operations (Def_Id,
- Direct_Primitive_Operations (T));
+ if Ada_Version >= Ada_2005 and then Is_Concurrent_Type (T) then
+ Set_Corresponding_Record_Type
+ (Def_Id, Corresponding_Record_Type (T));
end if;
Set_Is_Abstract_Type (Def_Id, Is_Abstract_Type (T));
Set_First_Rep_Item (Full, First_Rep_Item (Full_Base));
Set_Depends_On_Private (Full, Has_Private_Component (Full));
+ -- When prefixed calls are enabled for untagged types, the subtype
+ -- shares the primitive operations of its base type. Do this even
+ -- when GNAT extensions are not allowed, in order to give better
+ -- error messages.
+
+ Set_Direct_Primitive_Operations
+ (Full, Direct_Primitive_Operations (Full_Base));
+
-- Freeze the private subtype entity if its parent is delayed, and not
-- already frozen. We skip this processing if the type is an anonymous
-- subtype of a record component, or is the corresponding record of a
Set_Is_Tagged_Type (Full);
Set_Is_Limited_Record (Full, Is_Limited_Record (Full_Base));
- Set_Direct_Primitive_Operations
- (Full, Direct_Primitive_Operations (Full_Base));
Set_No_Tagged_Streams_Pragma
(Full, No_Tagged_Streams_Pragma (Full_Base));
-- Initialize the list of primitive operations to an empty list,
-- to cover tagged types as well as untagged types. For untagged
-- types this is used either to analyze the call as legal when
- -- Extensions_Allowed is True, or to issue a better error message
- -- otherwise.
+ -- GNAT extensions are allowed, or to give better error messages.
Set_Direct_Primitive_Operations (T, New_Elmt_List);