Match_Found : Boolean := False;
Is_Match : Boolean;
Match : Interp;
+
begin
if not Is_Type (Typ) then
Error_Msg_N ("aspect can only be specified for a type", ASN);
return;
+
elsif not Is_First_Subtype (Typ) then
Error_Msg_N ("aspect cannot be specified for a subtype", ASN);
return;
Error_Msg_N ("aspect cannot be specified for a string type", ASN);
return;
end if;
+
Param_Type := Standard_Wide_Wide_String;
+
else
if Is_Numeric_Type (Typ) then
Error_Msg_N ("aspect cannot be specified for a numeric type", ASN);
return;
end if;
+
Param_Type := Standard_String;
end if;
and then Base_Type (Etype (It.Nam)) = Typ
then
declare
- Params : constant List_Id :=
+ Params : constant List_Id :=
Parameter_Specifications (Parent (It.Nam));
Param_Spec : Node_Id;
Param_Id : Entity_Id;
+
begin
if List_Length (Params) = 1 then
Param_Spec := First (Params);
+
if not More_Ids (Param_Spec) then
Param_Id := Defining_Identifier (Param_Spec);
+
if Base_Type (Etype (Param_Id)) = Param_Type
- and then Ekind (Param_Id) = E_In_Parameter
+ and then Ekind (Param_Id) = E_In_Parameter
+ and then not Is_Aliased (Param_Id)
then
Is_Match := True;
end if;
Error_Msg_N ("aspect specification is ambiguous", ASN);
return;
end if;
+
Match_Found := True;
Match := It;
end if;
-----------------------------
-- Statically_Names_Object --
-----------------------------
+
function Statically_Names_Object (N : Node_Id) return Boolean is
begin
if Statically_Denotes_Object (N) then
then
return False;
end if;
+
declare
Comp : constant Entity_Id :=
Original_Record_Component (Entity (Selector_Name (N)));
begin
- -- In not calling Has_Discriminant_Dependent_Constraint here,
- -- we are anticipating a language definition fixup. The
- -- current definition of "statically names" includes the
- -- wording "the selector_name names a component that does
- -- not depend on a discriminant", which suggests that this
- -- call should not be commented out. But it appears likely
- -- that this wording will be updated to only apply to a
- -- component declared in a variant part. There is no need
- -- to disallow something like
- -- with Post => ... and then
- -- Some_Record.Some_Discrim_Dep_Array_Component'Old (I)
- -- since the evaluation of the 'Old prefix cannot raise an
- -- exception. If the language is not updated, then the call
- -- below to H_D_C_C will need to be uncommented.
-
- if Is_Declared_Within_Variant (Comp)
- -- or else Has_Discriminant_Dependent_Constraint (Comp)
- then
+ -- AI12-0373 confirms that we should not call
+ -- Has_Discriminant_Dependent_Constraint here which would be
+ -- too strong.
+
+ if Is_Declared_Within_Variant (Comp) then
return False;
end if;
end;