* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185525
138bc75d-0d04-0410-961f-
82ee72b054a4
+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
@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
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
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;
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)
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;
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,