Commit a4956515 by Arnaud Charlet

[multiple changes]

2012-03-19  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_ch4.adb (Analyze_Allocator): Detect an allocator generated
	by the build-in-place machinery where the designated type is
	indefinite, but the underlying type is not. Do not emit errors
	related to missing initialization in this case.

2012-03-19  Robert Dewar  <dewar@adacore.com>

	* gnat_ugn.texi: Add documentation for -gnateinnn switch.
	* sem_elab.adb, put_alfa.adb, lib-xref-alfa.adb: Minor reformatting.
	* sem_prag.adb: Minor comment update.

From-SVN: r185525
parent 04398fa8
2012-03-19 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch4.adb (Analyze_Allocator): Detect an allocator generated
by the build-in-place machinery where the designated type is
indefinite, but the underlying type is not. Do not emit errors
related to missing initialization in this case.
2012-03-19 Robert Dewar <dewar@adacore.com>
* gnat_ugn.texi: Add documentation for -gnateinnn switch.
* sem_elab.adb, put_alfa.adb, lib-xref-alfa.adb: Minor reformatting.
* sem_prag.adb: Minor comment update.
2012-03-15 Robert Dewar <dewar@adacore.com>
* errout.ads: Add entry for translating -gnateinn to
......
......@@ -4155,6 +4155,12 @@ Display full source path name in brief error messages.
@cindex @option{-gnateG} (@command{gcc})
Save result of preprocessing in a text file.
@item ^-gnatei^/MAX_INSTANTIATIONS=^@var{nnn}
@cindex @option{-gnatei} (@command{gcc})
Set maximum number of instantiations during compilation of a single unit to
@var{nnn}. This may be useful in increasing the default maximum of 8000 for
the rare case when a single unit legitimately exceeds this limit.
@item ^-gnateI^/MULTI_UNIT_INDEX=^@var{nnn}
@cindex @option{-gnateI} (@command{gcc})
Indicates that the source is a multi-unit source and that the index of the
......
......@@ -211,10 +211,10 @@ package body Alfa is
procedure Add_Alfa_File (U : Unit_Number_Type; D : Nat) is
From : Scope_Index;
S : constant Source_File_Index := Source_Index (U);
S : constant Source_File_Index := Source_Index (U);
File_Name, Unit_File_Name : String_Ptr;
File_Name : String_Ptr;
Unit_File_Name : String_Ptr;
begin
-- Source file could be inexistant as a result of an error, if option
......
......@@ -56,6 +56,7 @@ begin
Write_Info_Char ('-');
Write_Info_Char ('>');
Write_Info_Char (' ');
for N in F.Unit_File_Name'Range loop
Write_Info_Char (F.Unit_File_Name (N));
end loop;
......
......@@ -661,9 +661,22 @@ package body Sem_Ch4 is
if Is_Indefinite_Subtype (Type_Id)
and then Serious_Errors_Detected = Sav_Errs
then
if Is_Class_Wide_Type (Type_Id) then
-- The build-in-place machinery may produce an allocator when
-- the designated type is indefinite but the underlying type is
-- not. In this case the unknown discriminants are meaningless
-- and should not trigger error messages. Check the parent node
-- because the allocator is marked as coming from source.
if Present (Underlying_Type (Type_Id))
and then not Is_Indefinite_Subtype (Underlying_Type (Type_Id))
and then not Comes_From_Source (Parent (N))
then
null;
elsif Is_Class_Wide_Type (Type_Id) then
Error_Msg_N
("initialization required in class-wide allocation", N);
else
if Ada_Version < Ada_2005
and then Is_Limited_Type (Type_Id)
......
......@@ -2620,13 +2620,10 @@ package body Sem_Elab is
if No (Nam) then
return Empty;
elsif Nkind (Nam) = N_Selected_Component then
return Entity (Selector_Name (Nam));
elsif not Is_Entity_Name (Nam) then
return Empty;
else
return Entity (Nam);
end if;
......
......@@ -3704,7 +3704,7 @@ package body Sem_Prag is
Check_At_Most_N_Arguments (1);
-- Modeled internally as
-- pragma Unsuppress (Atomic_Synchronization [,Entity])
-- pragma Suppress/Unsuppress (Atomic_Synchronization [,Entity])
Rewrite (N,
Make_Pragma (Loc,
......
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