Commit df378148 by Arnaud Charlet

[multiple changes]

2012-06-14  Vincent Pucci  <pucci@adacore.com>

	* exp_ch6.adb (Expand_Call): Expand_Put_Call_With_Dimension_Symbol
	call replaced by Expand_Put_Call_With_Symbol call.
	* sem_dim.adb: New fields Unit_Names, Unit_Symbols
	and Dim_Symbols for record type System_Type.
	(From_Dimension_To_String_Of_Symbols): Removed.
	(From_Dim_To_Str_Of_Dim_Symbols): Renames previous
	routine From_Dimension_To_String_Of_Symbols.
	(From_Dim_To_Str_Of_Unit_Symbols): New routine.
	(Analyze_Aspect_Dimension): argument Symbol in aspect
	Dimension aggregate is optional. Named association implemented.
	(Has_Compile_Time_Known_Expressions): Removed.
	(Analyze_Aspect_Dimension_System): New
	component Dim_Symbol in each Dimension aggregate in
	aspect Dimension_System. Named associations implemented.
	(Add_Dimension_Vector_To_Buffer): Removed.
	(Add_Whole_To_Buffer): Removed.
	(Expand_Put_Call_With_Dimension_Symbol.): Removed.
	(Expand_Put_Call_With_Symbol): Renames previous routine
	Expand_Put_Call_With_Dimension_Symbol.
	(Has_Dimension_Symbols): Removed.
	(Has_Symbols): Renames previous routine
	Has_Dimension_Symbols.	(Store_String_Oexpon): New routine.
	* sem_dim.ads (Expand_Put_Call_With_Dimension_Symbol.): Removed.
	(Expand_Put_Call_With_Symbol): Renames previous routine
	Expand_Put_Call_With_Dimension_Symbol.
	* s-diflio.adb, s-diinio.adb (Put): Symbol renames Symbols.
	(Put_Dim_Of): New routines.
	* s-diflio.ads, s-diinio.ads: documentation updated.
	(Put): Symbol renames Symbols.
	(Put_Dim_Of): New routines.
	* s-dim.ads: documentation updated.
	* s-dimmks.ads: dimensioned type and subtypes updated.
	* snames.ads-tmpl: Name_Dim_Symbol, Name_Put_Dim_Of, Name_Symbol,
	and Name_Unit_Symbol added. Name_Symbols removed.

2012-06-14  Vincent Pucci  <pucci@adacore.com>

	* freeze.adb (In_Exp_Body): Expression function case added.
	(Freeze_Expression): Insert the Freeze_Nodes
	list before the correct current scope in case of a quantified
	expression.

2012-06-14  Pascal Obry  <obry@adacore.com>

	* projects.texi: Document the Install package for gprinstall.
2012-06-14  Ed Schonberg  <schonberg@adacore.com>

	* sem_elim.adb (Check_For_Eliminated_Subprogram): Do not check within
	a default expression.
	* sem_res.adb (Resolve_Call): simplify code.

2012-06-14  Ed Schonberg  <schonberg@adacore.com>

	* sem_case.adb (Check, Issue_Msg): within an instance, non-other
	values in a variant part or a case expression do not have to
	belong to the actual subtype.

2012-06-14  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch12.adb (Validate_Derived_Type_Instance): If parent is
	an interface type, check whether it is itself a previous formal
	already instantiated in the current list of actuals.

2012-06-14  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): The
	expression for a stream attribute is a name that may be overloaded
	with other declarations. To determine whether it matches the
	aspect at the freeze point, it is necessary to verify that one
	of its interpretations matches.

From-SVN: r188610
parent 2a290fec
2012-06-14 Vincent Pucci <pucci@adacore.com>
* exp_ch6.adb (Expand_Call): Expand_Put_Call_With_Dimension_Symbol
call replaced by Expand_Put_Call_With_Symbol call.
* sem_dim.adb: New fields Unit_Names, Unit_Symbols
and Dim_Symbols for record type System_Type.
(From_Dimension_To_String_Of_Symbols): Removed.
(From_Dim_To_Str_Of_Dim_Symbols): Renames previous
routine From_Dimension_To_String_Of_Symbols.
(From_Dim_To_Str_Of_Unit_Symbols): New routine.
(Analyze_Aspect_Dimension): argument Symbol in aspect
Dimension aggregate is optional. Named association implemented.
(Has_Compile_Time_Known_Expressions): Removed.
(Analyze_Aspect_Dimension_System): New
component Dim_Symbol in each Dimension aggregate in
aspect Dimension_System. Named associations implemented.
(Add_Dimension_Vector_To_Buffer): Removed.
(Add_Whole_To_Buffer): Removed.
(Expand_Put_Call_With_Dimension_Symbol.): Removed.
(Expand_Put_Call_With_Symbol): Renames previous routine
Expand_Put_Call_With_Dimension_Symbol.
(Has_Dimension_Symbols): Removed.
(Has_Symbols): Renames previous routine
Has_Dimension_Symbols. (Store_String_Oexpon): New routine.
* sem_dim.ads (Expand_Put_Call_With_Dimension_Symbol.): Removed.
(Expand_Put_Call_With_Symbol): Renames previous routine
Expand_Put_Call_With_Dimension_Symbol.
* s-diflio.adb, s-diinio.adb (Put): Symbol renames Symbols.
(Put_Dim_Of): New routines.
* s-diflio.ads, s-diinio.ads: documentation updated.
(Put): Symbol renames Symbols.
(Put_Dim_Of): New routines.
* s-dim.ads: documentation updated.
* s-dimmks.ads: dimensioned type and subtypes updated.
* snames.ads-tmpl: Name_Dim_Symbol, Name_Put_Dim_Of, Name_Symbol,
and Name_Unit_Symbol added. Name_Symbols removed.
2012-06-14 Vincent Pucci <pucci@adacore.com>
* freeze.adb (In_Exp_Body): Expression function case added.
(Freeze_Expression): Insert the Freeze_Nodes
list before the correct current scope in case of a quantified
expression.
2012-06-14 Pascal Obry <obry@adacore.com>
* projects.texi: Document the Install package for gprinstall.
2012-06-14 Ed Schonberg <schonberg@adacore.com>
* sem_elim.adb (Check_For_Eliminated_Subprogram): Do not check within
a default expression.
* sem_res.adb (Resolve_Call): simplify code.
2012-06-14 Ed Schonberg <schonberg@adacore.com>
* sem_case.adb (Check, Issue_Msg): within an instance, non-other
values in a variant part or a case expression do not have to
belong to the actual subtype.
2012-06-14 Ed Schonberg <schonberg@adacore.com>
* sem_ch12.adb (Validate_Derived_Type_Instance): If parent is
an interface type, check whether it is itself a previous formal
already instantiated in the current list of actuals.
2012-06-14 Ed Schonberg <schonberg@adacore.com>
* sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): The
expression for a stream attribute is a name that may be overloaded
with other declarations. To determine whether it matches the
aspect at the freeze point, it is necessary to verify that one
of its interpretations matches.
2012-06-14 Robert Dewar <dewar@adacore.com> 2012-06-14 Robert Dewar <dewar@adacore.com>
* exp_ch7.adb, exp_util.adb, sem_aux.ads, exp_ch9.adb, * exp_ch7.adb, exp_util.adb, sem_aux.ads, exp_ch9.adb,
......
...@@ -2389,7 +2389,7 @@ package body Exp_Ch6 is ...@@ -2389,7 +2389,7 @@ package body Exp_Ch6 is
and then Nkind (Call_Node) = N_Procedure_Call_Statement and then Nkind (Call_Node) = N_Procedure_Call_Statement
and then Present (Parameter_Associations (Call_Node)) and then Present (Parameter_Associations (Call_Node))
then then
Expand_Put_Call_With_Dimension_Symbol (Call_Node); Expand_Put_Call_With_Symbol (Call_Node);
end if; end if;
-- Remove the dimensions of every parameters in call -- Remove the dimensions of every parameters in call
......
...@@ -4698,13 +4698,15 @@ package body Freeze is ...@@ -4698,13 +4698,15 @@ package body Freeze is
Id := Defining_Unit_Name (Specification (P)); Id := Defining_Unit_Name (Specification (P));
if Nkind (Id) = N_Defining_Identifier if Nkind (Id) = N_Defining_Identifier
and then (Is_Init_Proc (Id) or else and then (Is_Init_Proc (Id) or else
Is_TSS (Id, TSS_Stream_Input) or else Is_TSS (Id, TSS_Stream_Input) or else
Is_TSS (Id, TSS_Stream_Output) or else Is_TSS (Id, TSS_Stream_Output) or else
Is_TSS (Id, TSS_Stream_Read) or else Is_TSS (Id, TSS_Stream_Read) or else
Is_TSS (Id, TSS_Stream_Write) or else Is_TSS (Id, TSS_Stream_Write) or else
Nkind (Original_Node (P)) = Nkind (Original_Node (P)) =
N_Subprogram_Renaming_Declaration) N_Subprogram_Renaming_Declaration or else
Nkind (Original_Node (P)) =
N_Expression_Function)
then then
return True; return True;
else else
...@@ -5091,9 +5093,9 @@ package body Freeze is ...@@ -5091,9 +5093,9 @@ package body Freeze is
or else Ekind (Current_Scope) = E_Void or else Ekind (Current_Scope) = E_Void
then then
declare declare
N : constant Node_Id := Current_Scope; N : constant Node_Id := Current_Scope;
Freeze_Nodes : List_Id := No_List; Freeze_Nodes : List_Id := No_List;
Pos : Int := Scope_Stack.Last; Pos : Int := Scope_Stack.Last;
begin begin
if Present (Desig_Typ) then if Present (Desig_Typ) then
...@@ -5109,13 +5111,18 @@ package body Freeze is ...@@ -5109,13 +5111,18 @@ package body Freeze is
end if; end if;
-- The current scope may be that of a constrained component of -- The current scope may be that of a constrained component of
-- an enclosing record declaration, which is above the current -- an enclosing record declaration, or of a loop of an enclosing
-- scope in the scope stack. -- quantified expression, which is above the current scope in the
-- scope stack. Indeed in the context of a quantified expression,
-- a scope is created and pushed above the current scope in order
-- to emulate the loop-like behavior of the quantified expression.
-- If the expression is within a top-level pragma, as for a pre- -- If the expression is within a top-level pragma, as for a pre-
-- condition on a library-level subprogram, nothing to do. -- condition on a library-level subprogram, nothing to do.
if not Is_Compilation_Unit (Current_Scope) if not Is_Compilation_Unit (Current_Scope)
and then Is_Record_Type (Scope (Current_Scope)) and then (Is_Record_Type (Scope (Current_Scope))
or else Nkind (Parent (Current_Scope)) =
N_Quantified_Expression)
then then
Pos := Pos - 1; Pos := Pos - 1;
end if; end if;
......
...@@ -226,6 +226,7 @@ should contain the following code: ...@@ -226,6 +226,7 @@ should contain the following code:
* Executable File Names:: * Executable File Names::
* Avoid Duplication With Variables:: * Avoid Duplication With Variables::
* Naming Schemes:: * Naming Schemes::
* Installation::
@end menu @end menu
@c --------------------------------------------- @c ---------------------------------------------
...@@ -1024,6 +1025,54 @@ names in lower case) ...@@ -1024,6 +1025,54 @@ names in lower case)
@end ifset @end ifset
@c --------------------------------------------- @c ---------------------------------------------
@node Installation
@subsection Installation
@c ---------------------------------------------
@noindent
After building an application or a library it is often required to
install it into the development environment. This installation is
required if the library is to be used by another application for
example. The @code{gprinstall} tool provide an easy way to install
libraries, executable or object code generated durting the build. The
@b{Install} package can be used to change the default locations.
The following attributes can be defined in package @code{Install}:
@table @asis
@item @b{Active}
Whether the project is to be installed, values are @code{true}
(default) or @code{false}.
@item @b{Prefix}:
@cindex @code{Prefix}
Root directory for the installation.
@item @b{Exec_Subdir}
Subdirectory of @b{Prefix} where executables are to be
installed. Default is @b{bin}.
@item @b{Lib_Subdir}
Subdirectory of @b{Prefix} where directory with the library or object
files is to be installed. Default is @b{lib}.
@item @b{Sources_Subdir}
Subdirectory of @b{Prefix} where directory with sources is to be
installed. Default is @b{include}.
@item @b{Project_Subdir}
Subdirectory of @b{Prefix} where the installed project is to be
installed. Default is @b{share/gpr}.
@end table
@c ---------------------------------------------
@node Organizing Projects into Subsystems @node Organizing Projects into Subsystems
@section Organizing Projects into Subsystems @section Organizing Projects into Subsystems
@c --------------------------------------------- @c ---------------------------------------------
...@@ -3039,6 +3088,9 @@ The following packages are currently supported in project files ...@@ -3039,6 +3088,9 @@ The following packages are currently supported in project files
This package specifies the options used when starting an integrated This package specifies the options used when starting an integrated
development environment, for instance @command{GPS} or @command{Gnatbench}. development environment, for instance @command{GPS} or @command{Gnatbench}.
@xref{The Development Environments}. @xref{The Development Environments}.
@item Install
This package specifies the options used when installing a project
with @command{gprinstall}. @xref{Installation}.
@item Linker @item Linker
This package specifies the options used by the linker. This package specifies the options used by the linker.
@xref{Main Subprograms}. @xref{Main Subprograms}.
......
...@@ -38,40 +38,72 @@ package body System.Dim.Float_IO is ...@@ -38,40 +38,72 @@ package body System.Dim.Float_IO is
--------- ---------
procedure Put procedure Put
(File : File_Type; (File : File_Type;
Item : Num_Dim_Float; Item : Num_Dim_Float;
Fore : Field := Default_Fore; Fore : Field := Default_Fore;
Aft : Field := Default_Aft; Aft : Field := Default_Aft;
Exp : Field := Default_Exp; Exp : Field := Default_Exp;
Symbols : String := "") Symbol : String := "")
is is
begin begin
Num_Dim_Float_IO.Put (File, Item, Fore, Aft, Exp); Num_Dim_Float_IO.Put (File, Item, Fore, Aft, Exp);
Ada.Text_IO.Put (File, Symbols); Ada.Text_IO.Put (File, Symbol);
end Put; end Put;
procedure Put procedure Put
(Item : Num_Dim_Float; (Item : Num_Dim_Float;
Fore : Field := Default_Fore; Fore : Field := Default_Fore;
Aft : Field := Default_Aft; Aft : Field := Default_Aft;
Exp : Field := Default_Exp; Exp : Field := Default_Exp;
Symbols : String := "") Symbol : String := "")
is is
begin begin
Num_Dim_Float_IO.Put (Item, Fore, Aft, Exp); Num_Dim_Float_IO.Put (Item, Fore, Aft, Exp);
Ada.Text_IO.Put (Symbols); Ada.Text_IO.Put (Symbol);
end Put; end Put;
procedure Put procedure Put
(To : out String; (To : out String;
Item : Num_Dim_Float; Item : Num_Dim_Float;
Aft : Field := Default_Aft; Aft : Field := Default_Aft;
Exp : Field := Default_Exp; Exp : Field := Default_Exp;
Symbols : String := "") Symbol : String := "")
is is
begin begin
Num_Dim_Float_IO.Put (To, Item, Aft, Exp); Num_Dim_Float_IO.Put (To, Item, Aft, Exp);
To := To & Symbols; To := To & Symbol;
end Put; end Put;
----------------
-- Put_Dim_Of --
----------------
pragma Warnings (Off);
-- kill warnings on unreferenced formals
procedure Put_Dim_Of
(File : File_Type;
Item : Num_Dim_Float;
Symbol : String := "")
is
begin
Ada.Text_IO.Put (File, Symbol);
end Put_Dim_Of;
procedure Put_Dim_Of
(Item : Num_Dim_Float;
Symbol : String := "")
is
begin
Ada.Text_IO.Put (Symbol);
end Put_Dim_Of;
procedure Put_Dim_Of
(To : out String;
Item : Num_Dim_Float;
Symbol : String := "")
is
begin
To := Symbol;
end Put_Dim_Of;
end System.Dim.Float_IO; end System.Dim.Float_IO;
...@@ -31,33 +31,63 @@ ...@@ -31,33 +31,63 @@
-- This package provides output routines for float dimensioned types. All Put -- This package provides output routines for float dimensioned types. All Put
-- routines are modelled after those in package Ada.Text_IO.Float_IO with the -- routines are modelled after those in package Ada.Text_IO.Float_IO with the
-- addition of an extra default parameter. -- addition of an extra default parameter. All Put_Dim_Of routines
-- output the dimension of Item in a symbolic manner.
-- Parameter Symbol may be used in the following manner (all the examples are -- Parameter Symbol may be used in the following manner (all the examples are
-- based on the MKS system of units as defined in package System.Dim.Mks): -- based on the MKS system of units defined in package System.Dim.Mks):
-- type Mks_Type is new Long_Long_Float
-- with
-- Dimension_System => (
-- (Unit_Name => Meter, Unit_Symbol => 'm', Dim_Symbol => 'L'),
-- (Unit_Name => Kilogram, Unit_Symbol => "kg", Dim_Symbol => 'M'),
-- (Unit_Name => Second, Unit_Symbol => 's', Dim_Symbol => 'T'),
-- (Unit_Name => Ampere, Unit_Symbol => 'A', Dim_Symbol => 'I'),
-- (Unit_Name => Kelvin, Unit_Symbol => 'K', Dim_Symbol => "Θ"),
-- (Unit_Name => Mole, Unit_Symbol => "mol", Dim_Symbol => 'N'),
-- (Unit_Name => Candela, Unit_Symbol => "cd", Dim_Symbol => 'J'));
-- Case 1. A value is supplied for Symbol -- Case 1. A value is supplied for Symbol
-- The string appears as a suffix of Item -- * Put : The string appears as a suffix of Item
-- * Put_Dim_Of : The string appears alone
-- Obj : Mks_Type := 2.6; -- Obj : Mks_Type := 2.6;
-- Put (Obj, 1, 1, 0, " dimensionless"); -- Put (Obj, 1, 1, 0, " dimensionless");
-- Put_Dim_Of (Obj, "dimensionless");
-- The corresponding output is: 2.6 dimensionless -- The corresponding outputs are:
-- $2.6 dimensionless
-- $dimensionless
-- Case 2. No value is supplied for Symbol and Item is dimensionless -- Case 2. No value is supplied for Symbol and Item is dimensionless
-- Item appears without a suffix -- * Put : Item appears without a suffix
-- * Put_Dim_Of : the output is []
-- Obj : Mks_Type := 2.6; -- Obj : Mks_Type := 2.6;
-- Put (Obj, 1, 1, 0); -- Put (Obj, 1, 1, 0);
-- Put_Dim_Of (Obj);
-- The corresponding output is: 2.6 -- The corresponding outputs are:
-- $2.6
-- $[]
-- Case 3. No value is supplied for Symbol and Item has a dimension -- Case 3. No value is supplied for Symbol and Item has a dimension
-- If the type of Item is a dimensioned subtype whose symbolic name is not -- * Put : If the type of Item is a dimensioned subtype whose
-- empty, then the symbolic name appears as a suffix. -- symbol is not empty, then the symbol appears as a suffix.
-- Otherwise, a new string is created and appears as a
-- suffix of Item. This string results in the successive
-- concatenations between each unit symbol raised by its
-- corresponding dimension power from the dimensions of Item.
-- * Put_Dim_Of : The output is a new string resulting in the successive
-- concatenations between each dimension symbol raised by its
-- corresponding dimension power from the dimensions of Item.
-- subtype Length is Mks_Type -- subtype Length is Mks_Type
-- with -- with
...@@ -67,29 +97,33 @@ ...@@ -67,29 +97,33 @@
-- Obj : Length := 2.3 * dm; -- Obj : Length := 2.3 * dm;
-- Put (Obj, 1, 2, 0); -- Put (Obj, 1, 2, 0);
-- Put_Dim_Of (Obj);
-- The corresponding output is: 0.23 m -- The corresponding outputs are:
-- $0.23 m
-- Otherwise, a new string is created and appears as a suffix of Item. -- $[L]
-- This string results in the successive concatanations between each
-- dimension symbolic name raised by its corresponding dimension power from
-- the dimensions of Item.
-- subtype Random is Mks_Type -- subtype Random is Mks_Type
-- with -- with
-- Dimension => ("", -- Dimension => (
-- Meter => 3, -- Meter => 3,
-- Candela => -1, -- Candela => -1,
-- others => 0); -- others => 0);
-- Obj : Random := 5.0; -- Obj : Random := 5.0;
-- Put (Obj); -- Put (Obj);
-- Put_Dim_Of (Obj);
-- The corresponding output is: 5.0 m**3.cd**(-1) -- The corresponding outputs are:
-- $5.0 m**3.cd**(-1)
-- $[l**3.J**(-1)]
-- Put (3.3 * km * dm * min, 5, 1, 0); -- Put (3.3 * km * dm * min, 5, 1, 0);
-- Put_Dim_Of (3.3 * km * dm * min);
-- The corresponding output is: 19800.0 m**2.s -- The corresponding outputs are:
-- $19800.0 m**2.s
-- $[L**2.T]
with Ada.Text_IO; use Ada.Text_IO; with Ada.Text_IO; use Ada.Text_IO;
...@@ -103,27 +137,42 @@ package System.Dim.Float_IO is ...@@ -103,27 +137,42 @@ package System.Dim.Float_IO is
Default_Exp : Field := 3; Default_Exp : Field := 3;
procedure Put procedure Put
(File : File_Type; (File : File_Type;
Item : Num_Dim_Float; Item : Num_Dim_Float;
Fore : Field := Default_Fore; Fore : Field := Default_Fore;
Aft : Field := Default_Aft; Aft : Field := Default_Aft;
Exp : Field := Default_Exp; Exp : Field := Default_Exp;
Symbols : String := ""); Symbol : String := "");
procedure Put procedure Put
(Item : Num_Dim_Float; (Item : Num_Dim_Float;
Fore : Field := Default_Fore; Fore : Field := Default_Fore;
Aft : Field := Default_Aft; Aft : Field := Default_Aft;
Exp : Field := Default_Exp; Exp : Field := Default_Exp;
Symbols : String := ""); Symbol : String := "");
procedure Put procedure Put
(To : out String; (To : out String;
Item : Num_Dim_Float; Item : Num_Dim_Float;
Aft : Field := Default_Aft; Aft : Field := Default_Aft;
Exp : Field := Default_Exp; Exp : Field := Default_Exp;
Symbols : String := ""); Symbol : String := "");
procedure Put_Dim_Of
(File : File_Type;
Item : Num_Dim_Float;
Symbol : String := "");
procedure Put_Dim_Of
(Item : Num_Dim_Float;
Symbol : String := "");
procedure Put_Dim_Of
(To : out String;
Item : Num_Dim_Float;
Symbol : String := "");
pragma Inline (Put); pragma Inline (Put);
pragma Inline (Put_Dim_Of);
end System.Dim.Float_IO; end System.Dim.Float_IO;
...@@ -38,40 +38,72 @@ package body System.Dim.Integer_IO is ...@@ -38,40 +38,72 @@ package body System.Dim.Integer_IO is
--------- ---------
procedure Put procedure Put
(File : File_Type; (File : File_Type;
Item : Num_Dim_Integer; Item : Num_Dim_Integer;
Width : Field := Default_Width; Width : Field := Default_Width;
Base : Number_Base := Default_Base; Base : Number_Base := Default_Base;
Symbols : String := "") Symbol : String := "")
is is
begin begin
Num_Dim_Integer_IO.Put (File, Item, Width, Base); Num_Dim_Integer_IO.Put (File, Item, Width, Base);
Ada.Text_IO.Put (File, Symbols); Ada.Text_IO.Put (File, Symbol);
end Put; end Put;
procedure Put procedure Put
(Item : Num_Dim_Integer; (Item : Num_Dim_Integer;
Width : Field := Default_Width; Width : Field := Default_Width;
Base : Number_Base := Default_Base; Base : Number_Base := Default_Base;
Symbols : String := "") Symbol : String := "")
is is
begin begin
Num_Dim_Integer_IO.Put (Item, Width, Base); Num_Dim_Integer_IO.Put (Item, Width, Base);
Ada.Text_IO.Put (Symbols); Ada.Text_IO.Put (Symbol);
end Put; end Put;
procedure Put procedure Put
(To : out String; (To : out String;
Item : Num_Dim_Integer; Item : Num_Dim_Integer;
Base : Number_Base := Default_Base; Base : Number_Base := Default_Base;
Symbols : String := "") Symbol : String := "")
is is
begin begin
Num_Dim_Integer_IO.Put (To, Item, Base); Num_Dim_Integer_IO.Put (To, Item, Base);
To := To & Symbols; To := To & Symbol;
end Put; end Put;
----------------
-- Put_Dim_Of --
----------------
pragma Warnings (Off);
-- kill warnings on unreferenced formals
procedure Put_Dim_Of
(File : File_Type;
Item : Num_Dim_Integer;
Symbol : String := "")
is
begin
Ada.Text_IO.Put (File, Symbol);
end Put_Dim_Of;
procedure Put_Dim_Of
(Item : Num_Dim_Integer;
Symbol : String := "")
is
begin
Ada.Text_IO.Put (Symbol);
end Put_Dim_Of;
procedure Put_Dim_Of
(To : out String;
Item : Num_Dim_Integer;
Symbol : String := "")
is
begin
To := Symbol;
end Put_Dim_Of;
end System.Dim.Integer_IO; end System.Dim.Integer_IO;
...@@ -31,44 +31,63 @@ ...@@ -31,44 +31,63 @@
-- This package provides output routines for integer dimensioned types. All -- This package provides output routines for integer dimensioned types. All
-- Put routines are modelled after those in package Ada.Text_IO.Integer_IO -- Put routines are modelled after those in package Ada.Text_IO.Integer_IO
-- with the addition of an extra default parameter. -- with the addition of an extra default parameter. All Put_Dim_Of routines
-- output the dimension of Item in a symbolic manner.
-- All the examples in this package are based on the MKS system of units: -- Parameter Symbol may be used in the following manner (all the examples are
-- based on the MKS system of units as defined in package System.Dim.Mks):
-- type Mks_Type is new Integer -- type Mks_Type is new Integer
-- with -- with
-- Dimension_System => ((Meter, 'm'), -- Dimension_System => (
-- (Kilogram, "kg"), -- (Unit_Name => Meter, Unit_Symbol => 'm', Dim_Symbol => 'L'),
-- (Second, 's'), -- (Unit_Name => Kilogram, Unit_Symbol => "kg", Dim_Symbol => 'M'),
-- (Ampere, 'A'), -- (Unit_Name => Second, Unit_Symbol => 's', Dim_Symbol => 'T'),
-- (Kelvin, 'K'), -- (Unit_Name => Ampere, Unit_Symbol => 'A', Dim_Symbol => 'I'),
-- (Mole, "mol"), -- (Unit_Name => Kelvin, Unit_Symbol => 'K', Dim_Symbol => "Θ"),
-- (Candela, "cd")); -- (Unit_Name => Mole, Unit_Symbol => "mol", Dim_Symbol => 'N'),
-- (Unit_Name => Candela, Unit_Symbol => "cd", Dim_Symbol => 'J'));
-- Parameter Symbol may be used in the following manner:
-- Case 1. A value is supplied for Symbol -- Case 1. A value is supplied for Symbol
-- The string appears as a suffix of Item -- * Put : The string appears as a suffix of Item
-- * Put_Dim_Of : The string appears alone
-- Obj : Mks_Type := 2; -- Obj : Mks_Type := 2;
-- Put (Obj, Symbols => " dimensionless"); -- Put (Obj, Symbols => "dimensionless");
-- Put_Dim_Of (Obj, Symbols => "dimensionless");
-- The corresponding output is: 2 dimensionless -- The corresponding outputs are:
-- $2 dimensionless
-- $dimensionless
-- Case 2. No value is supplied for Symbol and Item is dimensionless -- Case 2. No value is supplied for Symbol and Item is dimensionless
-- Item appears without a suffix -- * Put : Item appears without a suffix
-- * Put_Dim_Of : the output is []
-- Obj : Mks_Type := 2; -- Obj : Mks_Type := 2;
-- Put (Obj); -- Put (Obj);
-- Put_Dim_Of (Obj);
-- The corresponding output is: 2 -- The corresponding outputs are:
-- $2
-- $[]
-- Case 3. No value is supplied for Symbol and Item has a dimension -- Case 3. No value is supplied for Symbol and Item has a dimension
-- If the type of Item is a dimensioned subtype whose symbolic name is not -- * Put : If the type of Item is a dimensioned subtype whose
-- empty, then the symbolic name appears as a suffix. -- symbol is not empty, then the symbol appears as a suffix.
-- Otherwise, a new string is created and appears as a
-- suffix of Item. This string results in the successive
-- concatenations between each unit symbol raised by its
-- corresponding dimension power from the dimensions of Item.
-- * Put_Dim_Of : The output is a new string resulting in the successive
-- concatenations between each dimension symbol raised by its
-- corresponding dimension power from the dimensions of Item.
-- subtype Length is Mks_Type -- subtype Length is Mks_Type
-- with -- with
...@@ -78,25 +97,26 @@ ...@@ -78,25 +97,26 @@
-- Obj : Length := 2; -- Obj : Length := 2;
-- Put (Obj); -- Put (Obj);
-- Put_Dim_Of (Obj);
-- The corresponding output is: 2 m -- The corresponding outputs are:
-- $2 m
-- Otherwise, a new string is created and appears as a suffix of Item. -- $[L]
-- This string results in the successive concatanations between each
-- dimension symbolic name raised by its corresponding dimension power from
-- the dimensions of Item.
-- subtype Random is Mks_Type -- subtype Random is Mks_Type
-- with -- with
-- Dimension => ("", -- Dimension => ("",
-- Meter => 3, -- Meter => 3,
-- Candela => 2, -- Candela => 2,
-- others => 0); -- others => 0);
-- Obj : Random := 5; -- Obj : Random := 5;
-- Put (Obj); -- Put (Obj);
-- Put_Dim_Of (Obj);
-- The corresponding output is: 5 m**3.cd**2 -- The corresponding outputs are:
-- $5 m**3.cd**2
-- $[L**3.J**2]
with Ada.Text_IO; use Ada.Text_IO; with Ada.Text_IO; use Ada.Text_IO;
...@@ -109,24 +129,39 @@ package System.Dim.Integer_IO is ...@@ -109,24 +129,39 @@ package System.Dim.Integer_IO is
Default_Base : Number_Base := 10; Default_Base : Number_Base := 10;
procedure Put procedure Put
(File : File_Type; (File : File_Type;
Item : Num_Dim_Integer; Item : Num_Dim_Integer;
Width : Field := Default_Width; Width : Field := Default_Width;
Base : Number_Base := Default_Base; Base : Number_Base := Default_Base;
Symbols : String := ""); Symbol : String := "");
procedure Put procedure Put
(Item : Num_Dim_Integer; (Item : Num_Dim_Integer;
Width : Field := Default_Width; Width : Field := Default_Width;
Base : Number_Base := Default_Base; Base : Number_Base := Default_Base;
Symbols : String := ""); Symbol : String := "");
procedure Put procedure Put
(To : out String; (To : out String;
Item : Num_Dim_Integer; Item : Num_Dim_Integer;
Base : Number_Base := Default_Base; Base : Number_Base := Default_Base;
Symbols : String := ""); Symbol : String := "");
procedure Put_Dim_Of
(File : File_Type;
Item : Num_Dim_Integer;
Symbol : String := "");
procedure Put_Dim_Of
(Item : Num_Dim_Integer;
Symbol : String := "");
procedure Put_Dim_Of
(To : out String;
Item : Num_Dim_Integer;
Symbol : String := "");
pragma Inline (Put); pragma Inline (Put);
pragma Inline (Put_Dim_Of);
end System.Dim.Integer_IO; end System.Dim.Integer_IO;
...@@ -42,15 +42,14 @@ ...@@ -42,15 +42,14 @@
-- type Mks_Type is new Long_Long_Float -- type Mks_Type is new Long_Long_Float
-- with -- with
-- Dimension_System => ((Meter, 'm'), -- Dimension_System => (
-- (Kilogram, "kg"), -- (Unit_Name => Meter, Unit_Symbol => 'm', Dim_Symbol => 'L'),
-- (Second, 's'), -- (Unit_Name => Kilogram, Unit_Symbol => "kg", Dim_Symbol => 'M'),
-- (Ampere, 'A'), -- (Unit_Name => Second, Unit_Symbol => 's', Dim_Symbol => 'T'),
-- (Kelvin, 'K'), -- (Unit_Name => Ampere, Unit_Symbol => 'A', Dim_Symbol => 'I'),
-- (Mole, "mol"), -- (Unit_Name => Kelvin, Unit_Symbol => 'K', Dim_Symbol => "Θ"),
-- (Candela, "cd")); -- (Unit_Name => Mole, Unit_Symbol => "mol", Dim_Symbol => 'N'),
-- (Unit_Name => Candela, Unit_Symbol => "cd", Dim_Symbol => 'J'));
-- 'm' is the symbolic name of dimension Meter
-- * Dimensioned subtype -- * Dimensioned subtype
...@@ -59,12 +58,10 @@ ...@@ -59,12 +58,10 @@
-- subtype Length is Mks_Type -- subtype Length is Mks_Type
-- with -- with
-- Dimension => ('m', -- Dimension => (Symbol => 'm',
-- Meter => 1, -- Meter => 1,
-- others => 0); -- others => 0);
-- 'm' is the symbolic name of dimensioned subtype Length
package System.Dim is package System.Dim is
pragma Pure; pragma Pure;
......
...@@ -48,49 +48,50 @@ package System.Dim.Mks is ...@@ -48,49 +48,50 @@ package System.Dim.Mks is
type Mks_Type is new Long_Long_Float type Mks_Type is new Long_Long_Float
with with
Dimension_System => ((Meter, 'm'), Dimension_System => (
(Kilogram, "kg"), (Unit_Name => Meter, Unit_Symbol => 'm', Dim_Symbol => 'L'),
(Second, 's'), (Unit_Name => Kilogram, Unit_Symbol => "kg", Dim_Symbol => 'M'),
(Ampere, 'A'), (Unit_Name => Second, Unit_Symbol => 's', Dim_Symbol => 'T'),
(Kelvin, 'K'), (Unit_Name => Ampere, Unit_Symbol => 'A', Dim_Symbol => 'I'),
(Mole, "mol"), (Unit_Name => Kelvin, Unit_Symbol => 'K', Dim_Symbol => "Θ"),
(Candela, "cd")); (Unit_Name => Mole, Unit_Symbol => "mol", Dim_Symbol => 'N'),
(Unit_Name => Candela, Unit_Symbol => "cd", Dim_Symbol => 'J'));
-- SI Base dimensioned subtype -- SI Base dimensioned subtype
subtype Length is Mks_Type subtype Length is Mks_Type
with with
Dimension => ('m', Dimension => (Symbol => 'm',
Meter => 1, Meter => 1,
others => 0); others => 0);
subtype Mass is Mks_Type subtype Mass is Mks_Type
with with
Dimension => ("kg", Dimension => (Symbol => "kg",
Kilogram => 1, Kilogram => 1,
others => 0); others => 0);
subtype Time is Mks_Type subtype Time is Mks_Type
with with
Dimension => ('s', Dimension => (Symbol => 's',
Second => 1, Second => 1,
others => 0); others => 0);
subtype Electric_Current is Mks_Type subtype Electric_Current is Mks_Type
with with
Dimension => ('A', Dimension => (Symbol => 'A',
Ampere => 1, Ampere => 1,
others => 0); others => 0);
subtype Thermodynamic_Temperature is Mks_Type subtype Thermodynamic_Temperature is Mks_Type
with with
Dimension => ('K', Dimension => (Symbol => 'K',
Kelvin => 1, Kelvin => 1,
others => 0); others => 0);
subtype Amount_Of_Substance is Mks_Type subtype Amount_Of_Substance is Mks_Type
with with
Dimension => ("mol", Dimension => (Symbol => "mol",
Mole => 1, Mole => 1,
others => 0); others => 0);
subtype Luminous_Intensity is Mks_Type subtype Luminous_Intensity is Mks_Type
with with
Dimension => ("cd", Dimension => (Symbol => "cd",
Candela => 1, Candela => 1,
others => 0); others => 0);
...@@ -108,56 +109,56 @@ package System.Dim.Mks is ...@@ -108,56 +109,56 @@ package System.Dim.Mks is
subtype Angle is Mks_Type subtype Angle is Mks_Type
with with
Dimension => ("rad", Dimension => (Symbol => "rad",
others => 0); others => 0);
subtype Solid_Angle is Mks_Type subtype Solid_Angle is Mks_Type
with with
Dimension => ("sr", Dimension => (Symbol => "sr",
others => 0); others => 0);
subtype Frequency is Mks_Type subtype Frequency is Mks_Type
with with
Dimension => ("Hz", Dimension => (Symbol => "Hz",
Second => -1, Second => -1,
others => 0); others => 0);
subtype Force is Mks_Type subtype Force is Mks_Type
with with
Dimension => ('N', Dimension => (Symbol => 'N',
Meter => 1, Meter => 1,
Kilogram => 1, Kilogram => 1,
Second => -2, Second => -2,
others => 0); others => 0);
subtype Pressure is Mks_Type subtype Pressure is Mks_Type
with with
Dimension => ("Pa", Dimension => (Symbol => "Pa",
Meter => -1, Meter => -1,
Kilogram => 1, Kilogram => 1,
Second => -2, Second => -2,
others => 0); others => 0);
subtype Energy is Mks_Type subtype Energy is Mks_Type
with with
Dimension => ('J', Dimension => (Symbol => 'J',
Meter => 2, Meter => 2,
Kilogram => 1, Kilogram => 1,
Second => -2, Second => -2,
others => 0); others => 0);
subtype Power is Mks_Type subtype Power is Mks_Type
with with
Dimension => ('W', Dimension => (Symbol => 'W',
Meter => 2, Meter => 2,
Kilogram => 1, Kilogram => 1,
Second => -3, Second => -3,
others => 0); others => 0);
subtype Electric_Charge is Mks_Type subtype Electric_Charge is Mks_Type
with with
Dimension => ('C', Dimension => (Symbol => 'C',
Second => 1, Second => 1,
Ampere => 1, Ampere => 1,
others => 0); others => 0);
subtype Electric_Potential_Difference is Mks_Type subtype Electric_Potential_Difference is Mks_Type
with with
Dimension => ('V', Dimension => (Symbol => 'V',
Meter => 2, Meter => 2,
Kilogram => 1, Kilogram => 1,
Second => -3, Second => -3,
...@@ -165,7 +166,7 @@ package System.Dim.Mks is ...@@ -165,7 +166,7 @@ package System.Dim.Mks is
others => 0); others => 0);
subtype Electric_Capacitance is Mks_Type subtype Electric_Capacitance is Mks_Type
with with
Dimension => ('F', Dimension => (Symbol => 'F',
Meter => -2, Meter => -2,
Kilogram => -1, Kilogram => -1,
Second => 4, Second => 4,
...@@ -173,7 +174,7 @@ package System.Dim.Mks is ...@@ -173,7 +174,7 @@ package System.Dim.Mks is
others => 0); others => 0);
subtype Electric_Resistance is Mks_Type subtype Electric_Resistance is Mks_Type
with with
Dimension => ("Ω", Dimension => (Symbol => "Ω",
Meter => 2, Meter => 2,
Kilogram => 1, Kilogram => 1,
Second => -3, Second => -3,
...@@ -181,7 +182,7 @@ package System.Dim.Mks is ...@@ -181,7 +182,7 @@ package System.Dim.Mks is
others => 0); others => 0);
subtype Electric_Conductance is Mks_Type subtype Electric_Conductance is Mks_Type
with with
Dimension => ('S', Dimension => (Symbol => 'S',
Meter => -2, Meter => -2,
Kilogram => -1, Kilogram => -1,
Second => 3, Second => 3,
...@@ -189,7 +190,7 @@ package System.Dim.Mks is ...@@ -189,7 +190,7 @@ package System.Dim.Mks is
others => 0); others => 0);
subtype Magnetic_Flux is Mks_Type subtype Magnetic_Flux is Mks_Type
with with
Dimension => ("Wb", Dimension => (Symbol => "Wb",
Meter => 2, Meter => 2,
Kilogram => 1, Kilogram => 1,
Second => -2, Second => -2,
...@@ -197,14 +198,14 @@ package System.Dim.Mks is ...@@ -197,14 +198,14 @@ package System.Dim.Mks is
others => 0); others => 0);
subtype Magnetic_Flux_Density is Mks_Type subtype Magnetic_Flux_Density is Mks_Type
with with
Dimension => ('T', Dimension => (Symbol => 'T',
Kilogram => 1, Kilogram => 1,
Second => -2, Second => -2,
Ampere => -1, Ampere => -1,
others => 0); others => 0);
subtype Inductance is Mks_Type subtype Inductance is Mks_Type
with with
Dimension => ('H', Dimension => (Symbol => 'H',
Meter => 2, Meter => 2,
Kilogram => 1, Kilogram => 1,
Second => -2, Second => -2,
...@@ -212,40 +213,40 @@ package System.Dim.Mks is ...@@ -212,40 +213,40 @@ package System.Dim.Mks is
others => 0); others => 0);
subtype Celsius_Temperature is Mks_Type subtype Celsius_Temperature is Mks_Type
with with
Dimension => ("°C", Dimension => (Symbol => "°C",
Kelvin => 1, Kelvin => 1,
others => 0); others => 0);
subtype Luminous_Flux is Mks_Type subtype Luminous_Flux is Mks_Type
with with
Dimension => ("lm", Dimension => (Symbol => "lm",
Candela => 1, Candela => 1,
others => 0); others => 0);
subtype Illuminance is Mks_Type subtype Illuminance is Mks_Type
with with
Dimension => ("lx", Dimension => (Symbol => "lx",
Meter => -2, Meter => -2,
Candela => 1, Candela => 1,
others => 0); others => 0);
subtype Radioactivity is Mks_Type subtype Radioactivity is Mks_Type
with with
Dimension => ("Bq", Dimension => (Symbol => "Bq",
Second => -1, Second => -1,
others => 0); others => 0);
subtype Absorbed_Dose is Mks_Type subtype Absorbed_Dose is Mks_Type
with with
Dimension => ("Gy", Dimension => (Symbol => "Gy",
Meter => 2, Meter => 2,
Second => -2, Second => -2,
others => 0); others => 0);
subtype Equivalent_Dose is Mks_Type subtype Equivalent_Dose is Mks_Type
with with
Dimension => ("Sv", Dimension => (Symbol => "Sv",
Meter => 2, Meter => 2,
Second => -2, Second => -2,
others => 0); others => 0);
subtype Catalytic_Activity is Mks_Type subtype Catalytic_Activity is Mks_Type
with with
Dimension => ("kat", Dimension => (Symbol => "kat",
Second => -1, Second => -1,
Mole => 1, Mole => 1,
others => 0); others => 0);
......
...@@ -159,6 +159,15 @@ package body Sem_Case is ...@@ -159,6 +159,15 @@ package body Sem_Case is
Msg_Sloc : constant Source_Ptr := Sloc (Case_Node); Msg_Sloc : constant Source_Ptr := Sloc (Case_Node);
begin begin
-- AI05-0188 : within an instance the non-others choices do not
-- have to belong to the actual subtype.
if Ada_Version >= Ada_2012
and then In_Instance
then
return;
end if;
-- In some situations, we call this with a null range, and -- In some situations, we call this with a null range, and
-- obviously we don't want to complain in this case! -- obviously we don't want to complain in this case!
...@@ -718,6 +727,14 @@ package body Sem_Case is ...@@ -718,6 +727,14 @@ package body Sem_Case is
Raises_CE := True; Raises_CE := True;
return; return;
-- AI05-0188 : within an instance the non-others choices do not
-- have to belong to the actual subtype.
elsif Ada_Version >= Ada_2012
and then In_Instance
then
return;
-- Otherwise we have an OK static choice -- Otherwise we have an OK static choice
else else
......
...@@ -10811,6 +10811,11 @@ package body Sem_Ch12 is ...@@ -10811,6 +10811,11 @@ package body Sem_Ch12 is
pragma Assert (Present (Ancestor)); pragma Assert (Present (Ancestor));
-- the ancestor itself may be a previous formal that
-- has been instantiated.
Ancestor := Get_Instance_Of (Ancestor);
else else
Ancestor := Ancestor :=
Get_Instance_Of (Base_Type (Get_Instance_Of (A_Gen_T))); Get_Instance_Of (Base_Type (Get_Instance_Of (A_Gen_T)));
......
...@@ -6136,7 +6136,11 @@ package body Sem_Ch13 is ...@@ -6136,7 +6136,11 @@ package body Sem_Ch13 is
if A_Id = Aspect_Synchronization then if A_Id = Aspect_Synchronization then
return; return;
-- Case of stream attributes, just have to compare entities -- Case of stream attributes, just have to compare entities. However,
-- the expression is just a name (possibly overloaded), and there may
-- be stream operations declared for unrelated types, so we just need
-- to verify that one of these interpretations is the one available at
-- at the freeze point.
elsif A_Id = Aspect_Input or else elsif A_Id = Aspect_Input or else
A_Id = Aspect_Output or else A_Id = Aspect_Output or else
...@@ -6144,7 +6148,29 @@ package body Sem_Ch13 is ...@@ -6144,7 +6148,29 @@ package body Sem_Ch13 is
A_Id = Aspect_Write A_Id = Aspect_Write
then then
Analyze (End_Decl_Expr); Analyze (End_Decl_Expr);
Err := Entity (End_Decl_Expr) /= Entity (Freeze_Expr);
if not Is_Overloaded (End_Decl_Expr) then
Err := Entity (End_Decl_Expr) /= Entity (Freeze_Expr);
else
Err := True;
declare
Index : Interp_Index;
It : Interp;
begin
Get_First_Interp (End_Decl_Expr, Index, It);
while Present (It.Typ) loop
if It.Nam = Entity (Freeze_Expr) then
Err := False;
exit;
end if;
Get_Next_Interp (Index, It);
end loop;
end;
end if;
elsif A_Id = Aspect_Variable_Indexing or else elsif A_Id = Aspect_Variable_Indexing or else
A_Id = Aspect_Constant_Indexing or else A_Id = Aspect_Constant_Indexing or else
......
...@@ -137,7 +137,7 @@ package Sem_Dim is ...@@ -137,7 +137,7 @@ package Sem_Dim is
-- restricted to Integer exponent. This routine deals only with rational -- restricted to Integer exponent. This routine deals only with rational
-- exponent which is not an integer if Btyp is a dimensioned type. -- exponent which is not an integer if Btyp is a dimensioned type.
procedure Expand_Put_Call_With_Dimension_Symbol (N : Node_Id); procedure Expand_Put_Call_With_Symbol (N : Node_Id);
-- Determine whether N denotes a subprogram call to one of the routines -- Determine whether N denotes a subprogram call to one of the routines
-- defined in System.Dim.Float_IO or System.Dim.Integer_IO and add an -- defined in System.Dim.Float_IO or System.Dim.Integer_IO and add an
-- extra actual to the call to represent the symbolic representation of -- extra actual to the call to represent the symbolic representation of
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1997-2010, Free Software Foundation, Inc. -- -- Copyright (C) 1997-2012, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -724,6 +724,14 @@ package body Sem_Elim is ...@@ -724,6 +724,14 @@ package body Sem_Elim is
Enclosing_Subp : Entity_Id; Enclosing_Subp : Entity_Id;
begin begin
-- No check needed within a default expression for a formal, since this
-- is not really a use, and the expression (a call or attribute) may
-- never be used if the enclosing subprogram is itself eliminated.
if In_Spec_Expression then
return;
end if;
if Is_Eliminated (Ultimate_Subp) if Is_Eliminated (Ultimate_Subp)
and then not Inside_A_Generic and then not Inside_A_Generic
and then not Is_Generic_Unit (Cunit_Entity (Current_Sem_Unit)) and then not Is_Generic_Unit (Cunit_Entity (Current_Sem_Unit))
...@@ -823,10 +831,10 @@ package body Sem_Elim is ...@@ -823,10 +831,10 @@ package body Sem_Elim is
Arg_Uname : Node_Id; Arg_Uname : Node_Id;
function OK_Selected_Component (N : Node_Id) return Boolean; function OK_Selected_Component (N : Node_Id) return Boolean;
-- Test if N is a selected component with all identifiers, or a -- Test if N is a selected component with all identifiers, or a selected
-- selected component whose selector is an operator symbol. As a -- component whose selector is an operator symbol. As a side effect if
-- side effect if result is True, sets Num_Names to the number -- result is True, sets Num_Names to the number of names present
-- of names present (identifiers and operator if any). -- (identifiers, and operator if any).
--------------------------- ---------------------------
-- OK_Selected_Component -- -- OK_Selected_Component --
......
...@@ -5839,14 +5839,11 @@ package body Sem_Res is ...@@ -5839,14 +5839,11 @@ package body Sem_Res is
Check_Restriction (No_Relative_Delay, N); Check_Restriction (No_Relative_Delay, N);
end if; end if;
-- Issue an error for a call to an eliminated subprogram. We skip this -- Issue an error for a call to an eliminated subprogram.
-- in a spec expression, e.g. a call in a default parameter value, since -- The routine will not perform the check if the call appears within
-- we are not really doing a call at this time. That's important because -- a default expression.
-- the spec expression may itself belong to an eliminated subprogram.
if not In_Spec_Expression then Check_For_Eliminated_Subprogram (Subp, Nam);
Check_For_Eliminated_Subprogram (Subp, Nam);
end if;
-- In formal mode, the primitive operations of a tagged type or type -- In formal mode, the primitive operations of a tagged type or type
-- extension do not include functions that return the tagged type. -- extension do not include functions that return the tagged type.
......
...@@ -225,9 +225,12 @@ package Snames is ...@@ -225,9 +225,12 @@ package Snames is
-- Names used by the analyzer and expander for aspect Dimension and -- Names used by the analyzer and expander for aspect Dimension and
-- Dimension_System to deal with Sqrt and IO routines. -- Dimension_System to deal with Sqrt and IO routines.
Name_Item : constant Name_Id := N + $; -- Ada 12 Name_Dim_Symbol : constant Name_Id := N + $; -- Ada 12
Name_Sqrt : constant Name_Id := N + $; -- Ada 12 Name_Item : constant Name_Id := N + $; -- Ada 12
Name_Symbols : constant Name_Id := N + $; -- Ada 12 Name_Put_Dim_Of : constant Name_Id := N + $; -- Ada 12
Name_Sqrt : constant Name_Id := N + $; -- Ada 12
Name_Symbol : constant Name_Id := N + $; -- Ada 12
Name_Unit_Symbol : constant Name_Id := N + $; -- Ada 12
-- Some miscellaneous names used for error detection/recovery -- Some miscellaneous names used for error detection/recovery
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment