+2014-06-13 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch3.adb, sem_ch9.adb, a-coinho.adb, a-coinho.ads: Minor
+ reformatting.
+
2014-06-13 Hristian Kirtchev <kirtchev@adacore.com>
* sem_prag.adb (Analyze_Pragma): Add local
-- --
-- B o d y --
-- --
--- Copyright (C) 2014, Free Software Foundation, Inc. --
+-- Copyright (C) 2012-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
overriding procedure Adjust (Control : in out Reference_Control_Type) is
begin
if Control.Container /= null then
- Control.Container.Busy := Control.Container.Busy + 1;
+ declare
+ B : Natural renames Control.Container.Busy;
+ begin
+ B := B + 1;
+ end;
end if;
end Adjust;
(Container : aliased Holder) return Constant_Reference_Type
is
Ref : constant Constant_Reference_Type :=
- (Element => Container.Element,
+ (Element => Container.Element.all'Access,
Control => (Controlled with Container'Unrestricted_Access));
+ B : Natural renames Ref.Control.Container.Busy;
begin
+ B := B + 1;
return Ref;
end Constant_Reference;
Free (Container.Element);
end Finalize;
- overriding procedure Finalize (Control : in out Reference_Control_Type)
- is
+ overriding procedure Finalize (Control : in out Reference_Control_Type) is
begin
if Control.Container /= null then
- Control.Container.Busy := Control.Container.Busy - 1;
-
+ declare
+ B : Natural renames Control.Container.Busy;
+ begin
+ B := B - 1;
+ end;
end if;
+
Control.Container := null;
end Finalize;
(Container : aliased in out Holder) return Reference_Type
is
Ref : constant Reference_Type :=
- (Element => Container.Element,
+ (Element => Container.Element.all'Access,
Control => (Controlled with Container'Unrestricted_Access));
begin
+ Container.Busy := Container.Busy + 1;
return Ref;
end Reference;
---------------
function To_Holder (New_Item : Element_Type) return Holder is
+
-- The element allocator may need an accessibility check in the case the
-- actual type is class-wide or has access discriminants (RM 4.8(10.1)
-- and AI12-0035).
Element_Type'Output (Stream, Container.Element.all);
end if;
end Write;
+
procedure Write
(Stream : not null access Root_Stream_Type'Class;
Item : Reference_Type)
-- --
-- S p e c --
-- --
--- Copyright (C) 2014, Free Software Foundation, Inc. --
+-- Copyright (C) 2011-2014, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
pragma Inline (Finalize);
type Constant_Reference_Type
- (Element : not null access constant Element_Type)
- is record
+ (Element : not null access constant Element_Type) is
+ record
Control : Reference_Control_Type;
end record;
for Constant_Reference_Type'Read use Read;
- type Reference_Type
- (Element : not null access Element_Type)
- is record
+ type Reference_Type (Element : not null access Element_Type) is record
Control : Reference_Control_Type;
end record;
end if;
elsif Nkind (N) = N_Full_Type_Declaration
- and then
- (Nkind (Type_Definition (N)) = N_Record_Definition
- or else Nkind (Type_Definition (N))
- = N_Derived_Type_Definition)
- and then Interface_Present (Type_Definition (N))
+ and then Nkind_In
+ (Type_Definition (N), N_Record_Definition,
+ N_Derived_Type_Definition)
+ and then Interface_Present (Type_Definition (N))
then
Error_Msg_N
("completion of private type cannot be an interface", N);
if Present (Iface) then
Error_Msg_NE
- ("interface in partial view& not implemented by full type " &
- "(RM-2005 7.3 (7.3/2))", Full_T, Iface);
+ ("interface in partial view& not implemented by full type "
+ & "(RM-2005 7.3 (7.3/2))", Full_T, Iface);
end if;
Iface := Find_Hidden_Interface (Full_T_Ifaces, Priv_T_Ifaces);
if Present (Iface) then
Error_Msg_NE
- ("interface & not implemented by partial view " &
- "(RM-2005 7.3 (7.3/2))", Full_T, Iface);
+ ("interface & not implemented by partial view "
+ & "(RM-2005 7.3 (7.3/2))", Full_T, Iface);
end if;
end;
end if;
if Priv_Parent = Any_Type or else Full_Parent = Any_Type then
return;
- -- Ada 2005 (AI-251): Interfaces in the full-typ can be given in
+ -- Ada 2005 (AI-251): Interfaces in the full type can be given in
-- any order. Therefore we don't have to check that its parent must
-- be a descendant of the parent of the private type declaration.
if Present (Iface) then
Error_Msg_NE
("interface in partial view& not implemented by full "
- & "type (RM-2005 7.3 (7.3/2))", T, Iface);
+ & "type (RM-2005 7.3 (7.3/2))", T, Iface);
end if;
Iface := Find_Hidden_Interface (Full_T_Ifaces, Priv_T_Ifaces);