+2009-04-15 Thomas Quinot <quinot@adacore.com>
+
+ * sem_warn.ads: Minor reformatting
+
+2009-04-15 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch3.adb: better error message for illegal interfaces
+
+ * sem_ch6.adb (Possible_Freeze): Delay freezing a subprogram if a
+ formal is an incomplete type from a limited_with clause.
+
2009-04-15 Vincent Celier <celier@adacore.com>
* prj-nmsc.adb (Locate_Directory): New Boolean parameter
or else Protected_Present (Iface_Def)
or else Synchronized_Present (Iface_Def))
and then Nkind (N) /= N_Private_Extension_Declaration
+ and then not Error_Posted (N)
then
Error_Msg_NE
("progenitor& must be limited interface",
null;
elsif Protected_Present (Iface_Def) then
- Error_Msg_N
- ("(Ada 2005) limited interface cannot "
- & "inherit from protected interface", Indic);
+ Error_Msg_NE
+ ("descendant of& must be declared"
+ & " as a protected interface",
+ N, Parent_Type);
elsif Synchronized_Present (Iface_Def) then
- Error_Msg_N
- ("(Ada 2005) limited interface cannot "
- & "inherit from synchronized interface", Indic);
+ Error_Msg_NE
+ ("descendant of& must be declared"
+ & " as a synchronized interface",
+ N, Parent_Type);
elsif Task_Present (Iface_Def) then
- Error_Msg_N
- ("(Ada 2005) limited interface cannot "
- & "inherit from task interface", Indic);
+ Error_Msg_NE
+ ("descendant of& must be declared as a task interface",
+ N, Parent_Type);
else
Error_Msg_N
null;
elsif Protected_Present (Iface_Def) then
- Error_Msg_N
- ("(Ada 2005) non-limited interface cannot "
- & "inherit from protected interface", Indic);
+ Error_Msg_NE
+ ("descendant of& must be declared"
+ & " as a protected interface",
+ N, Parent_Type);
elsif Synchronized_Present (Iface_Def) then
- Error_Msg_N
- ("(Ada 2005) non-limited interface cannot "
- & "inherit from synchronized interface", Indic);
+ Error_Msg_NE
+ ("descendant of& must be declared"
+ & " as a synchronized interface",
+ N, Parent_Type);
elsif Task_Present (Iface_Def) then
- Error_Msg_N
- ("(Ada 2005) non-limited interface cannot "
- & "inherit from task interface", Indic);
-
+ Error_Msg_NE
+ ("descendant of& must be declared as a task interface",
+ N, Parent_Type);
else
null;
end if;
procedure Set_Formal_Validity (Formal_Id : Entity_Id);
-- Formal_Id is an formal parameter entity. This procedure deals with
- -- setting the proper validity status for this entity, which depends
- -- on the kind of parameter and the validity checking mode.
+ -- setting the proper validity status for this entity, which depends on
+ -- the kind of parameter and the validity checking mode.
------------------------------
-- Analyze_Return_Statement --
procedure Possible_Freeze (T : Entity_Id);
-- T is the type of either a formal parameter or of the return type.
-- If T is not yet frozen and needs a delayed freeze, then the
- -- subprogram itself must be delayed.
+ -- subprogram itself must be delayed. If T is the limited view of
+ -- of an incomplete type the subprogram must be frozen as well,
+ -- because T may depend on local types that have not been frozen yet.
---------------------
-- Possible_Freeze --
and then not Is_Frozen (Designated_Type (T))
then
Set_Has_Delayed_Freeze (Designator);
+
+ elsif Ekind (T) = E_Incomplete_Type
+ and then From_With_Type (T)
+ then
+ Set_Has_Delayed_Freeze (Designator);
end if;
end Possible_Freeze;
procedure Check_Low_Bound_Tested (Expr : Node_Id);
-- Expr is the node for a comparison operation. This procedure checks if
-- the comparison is a source comparison of P'First with some other value
- -- and if so, sets the Low_Bound_Tested flag in Expr to suppress warnings
- -- about improper low bound assumptions (we assume that if the code has a
- -- test that explicitly checks X'First, then it is not operating in blind
- -- assumption mode).
+ -- and if so, sets the Low_Bound_Tested flag on entity P to suppress
+ -- warnings about improper low bound assumptions (we assume that if the
+ -- code has a test that explicitly checks P'First, then it is not operating
+ -- in blind assumption mode).
procedure Warn_On_Known_Condition (C : Node_Id);
-- C is a node for a boolean expression resulting from a relational