+2014-01-27 Robert Dewar <dewar@adacore.com>
+
+ * gnat_ugn.texi: Add Short_Enums to documentation of
+ -gnatet/-gnateT.
+
+2014-01-27 Robert Dewar <dewar@adacore.com>
+
+ * sem_prag.adb (Analyze_Input_Item): Correct check for input
+ item in same package.
+ * sem_util.ads, sem_util.adb (Within_Scope): New function.
+
2014-01-26 Arnaud Charlet <charlet@adacore.com>
* a-intnam-lynxos.ads, mlib-tgt-specific-lynxos.adb,
Maximum_Alignment : Pos; -- Maximum permitted alignment
Max_Unaligned_Field : Pos; -- Maximum size for unaligned bit field
Pointer_Size : Pos; -- System.Address'Size
+Short_Enums : Nat; -- Short foreign convention enums?
Short_Size : Pos; -- Standard.Short_Integer'Size
Strict_Alignment : Nat; -- Strict alignment?
System_Allocator_Alignment : Nat; -- Alignment for malloc calls
-- The input cannot denote states or variables declared
-- within the related package.
- if In_Same_Code_Unit (Item, Input_Id) then
+ if Within_Scope (Input_Id, Current_Scope) then
Error_Msg_Name_1 := Chars (Pack_Id);
Error_Msg_NE
("input item & cannot denote a visible variable or "
- & "state of package %", Input, Input_Id);
+ & "state in package %", Input, Input_Id);
-- Detect a duplicate use of the same input item
return Is_Init_Proc (S);
end Within_Init_Proc;
+ ------------------
+ -- Within_Scope --
+ ------------------
+
+ function Within_Scope (E : Entity_Id; S : Entity_Id) return Boolean is
+ SE : Entity_Id;
+ begin
+ SE := Scope (E);
+ loop
+ if SE = S then
+ return True;
+ elsif SE = Standard_Standard then
+ return False;
+ else
+ SE := Scope (SE);
+ end if;
+ end loop;
+ end Within_Scope;
+
----------------
-- Wrong_Type --
----------------
function Within_Init_Proc return Boolean;
-- Determines if Current_Scope is within an init proc
+ function Within_Scope (E : Entity_Id; S : Entity_Id) return Boolean;
+ -- Returns True if entity Id is declared within scope S
+
procedure Wrong_Type (Expr : Node_Id; Expected_Type : Entity_Id);
-- Output error message for incorrectly typed expression. Expr is the node
-- for the incorrectly typed construct (Etype (Expr) is the type found),