Hival : Ureal;
Atype : Entity_Id;
+ Orig_Lo : Ureal;
+ Orig_Hi : Ureal;
+ -- Save original bounds (for shaving tests)
+
Actual_Size : Nat;
+ -- Actual size chosen
function Fsize (Lov, Hiv : Ureal) return Nat;
-- Returns size of type with given bounds. Also leaves these
Loval := Realval (Lo);
Hival := Realval (Hi);
+ Orig_Lo := Loval;
+ Orig_Hi := Hival;
+
-- Ordinary fixed-point case
if Is_Ordinary_Fixed_Point_Type (Typ) then
Set_RM_Size (Typ, Minsiz);
end if;
end;
+
+ -- Check for shaving
+
+ if Comes_From_Source (Typ) then
+ if Orig_Lo < Expr_Value_R (Lo) then
+ Error_Msg_N
+ ("declared low bound of type & is outside type range??", Typ);
+ Error_Msg_N
+ ("\low bound adjusted up by delta (RM 3.5.9(13))??", Typ);
+ end if;
+
+ if Orig_Hi > Expr_Value_R (Hi) then
+ Error_Msg_N
+ ("declared high bound of type & is outside type range??", Typ);
+ Error_Msg_N
+ ("\high bound adjusted down by delta (RM 3.5.9(13))??", Typ);
+ end if;
+ end if;
end Freeze_Fixed_Point_Type;
------------------
-- check whether any of them is completed by the expression function.
-- In a generic context a formal subprogram has no completion.
- if Present (Prev) and then Is_Overloadable (Prev)
+ if Present (Prev)
+ and then Is_Overloadable (Prev)
and then not Is_Formal_Subprogram (Prev)
then
Def_Id := Analyze_Subprogram_Specification (Spec);
-- scope. The entity itself may be internally created if within a body
-- to be inlined.
- elsif Present (Prev) and then Comes_From_Source (Parent (Prev))
+ elsif Present (Prev)
+ and then Comes_From_Source (Parent (Prev))
and then not Is_Formal_Subprogram (Prev)
then
Set_Has_Completion (Prev, False);
elsif Ekind (Typ) = E_Incomplete_Type
or else (Is_Class_Wide_Type (Typ)
- and then Ekind (Root_Type (Typ)) = E_Incomplete_Type)
+ and then Ekind (Root_Type (Typ)) = E_Incomplete_Type)
then
-- AI05-0151: Tagged incomplete types are allowed in all formal
-- parts. Untagged incomplete types are not allowed in bodies.
-- a null access (see Expand_Interface_Conversion)
and then not (Is_Interface (Designated_Type (Etype (Scop)))
- and then not Comes_From_Source (Parent (Scop)))
+ and then not Comes_From_Source (Parent (Scop)))
and then (Has_Task (Designated_Type (Etype (Scop)))
or else
- (Is_Class_Wide_Type (Designated_Type (Etype (Scop)))
- and then
- Is_Limited_Record (Designated_Type (Etype (Scop)))))
+ (Is_Class_Wide_Type (Designated_Type (Etype (Scop)))
+ and then
+ Is_Limited_Record (Designated_Type (Etype (Scop)))))
and then Expander_Active
-- Avoid cases with no tasking support
Nkind (N) = N_Pragma
and then
(Pragma_Name (N) = Name_Inline_Always
- or else
- (Front_End_Inlining
- and then Pragma_Name (N) = Name_Inline))
+ or else (Front_End_Inlining
+ and then Pragma_Name (N) = Name_Inline))
and then
Chars
(Expression (First (Pragma_Argument_Associations (N)))) =
if To_Corresponding then
if Is_Concurrent_Type (Formal_Typ)
and then Present (Corresponding_Record_Type (Formal_Typ))
- and then Present (Interfaces (
- Corresponding_Record_Type (Formal_Typ)))
+ and then
+ Present (Interfaces
+ (Corresponding_Record_Type (Formal_Typ)))
then
Set_Etype (Formal,
Corresponding_Record_Type (Formal_Typ));
begin
if Must_Override (Body_Spec) then
if Nkind (Spec_Id) = N_Defining_Operator_Symbol
- and then Operator_Matches_Spec (Spec_Id, Spec_Id)
+ and then Operator_Matches_Spec (Spec_Id, Spec_Id)
then
null;
Body_Spec, Spec_Id);
elsif Nkind (Spec_Id) = N_Defining_Operator_Symbol
- and then Operator_Matches_Spec (Spec_Id, Spec_Id)
+ and then Operator_Matches_Spec (Spec_Id, Spec_Id)
then
Error_Msg_NE
("subprogram& overrides predefined operator ",
and then not Comes_From_Source (N)
and then
(Nkind (Original_Node (Spec_Decl)) =
- N_Subprogram_Renaming_Declaration
+ N_Subprogram_Renaming_Declaration
or else (Present (Corresponding_Body (Spec_Decl))
and then
Nkind (Unit_Declaration_Node
-- F_Ptr. We catch this case in the code below.
and then (Ekind (Old_Formal_Base) = Ekind (New_Formal_Base)
- or else
- (Is_Generic_Type (Old_Formal_Base)
- and then Is_Generic_Type (New_Formal_Base)
- and then Is_Internal (New_Formal_Base)
- and then Etype (Etype (New_Formal_Base)) =
- Old_Formal_Base))
- and then Directly_Designated_Type (Old_Formal_Base) =
- Directly_Designated_Type (New_Formal_Base)
+ or else
+ (Is_Generic_Type (Old_Formal_Base)
+ and then Is_Generic_Type (New_Formal_Base)
+ and then Is_Internal (New_Formal_Base)
+ and then Etype (Etype (New_Formal_Base)) =
+ Old_Formal_Base))
+ and then Directly_Designated_Type (Old_Formal_Base) =
+ Directly_Designated_Type (New_Formal_Base)
and then ((Is_Itype (Old_Formal_Base)
and then Can_Never_Be_Null (Old_Formal_Base))
- or else
- (Is_Itype (New_Formal_Base)
- and then Can_Never_Be_Null (New_Formal_Base)));
+ or else
+ (Is_Itype (New_Formal_Base)
+ and then Can_Never_Be_Null (New_Formal_Base)));
-- Types must always match. In the visible part of an instance,
-- usual overloading rules for dispatching operations apply, and