+2011-09-02 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch10.adb (Analyze_With_Clause): If the library unit
+ is the generated subprogram declaration for a child unit body
+ that acts as spec, use the original body in the with_clause,
+ to prevent binding errors.
+
+2011-09-02 Vincent Celier <celier@adacore.com>
+
+ * gnat_ugn.texi: Adapt documentation of -gnateInnn to new VMS
+ qualifier /MULTI_UNIT_INDEX=
+
+2011-09-02 Johannes Kanig <kanig@adacore.com>
+
+ * g-comlin.adb (Getopt): Return when switch is dealt with automatically,
+ instead of calling the callback function
+
2011-09-02 Robert Dewar <dewar@adacore.com>
* prj-proc.adb, prj.ads, sem_util.adb, s-taprop-linux.adb,
with "Expected integer parameter for '"
& Switch & "'";
end;
+ return;
when Switch_String =>
Free (Config.Switches (Index).String_Output.all);
Config.Switches (Index).String_Output.all :=
new String'(Parameter);
+ return;
+
end case;
end if;
Callback : Switch_Handler := null;
Parser : Opt_Parser := Command_Line_Parser);
-- Similar to the standard Getopt function.
- -- For each switch found on the command line, this calls Callback.
+ -- For each switch found on the command line, this calls Callback, if the
+ -- switch is not handled automatically.
--
-- The list of valid switches are the ones from the configuration. The
-- switches that were declared through Define_Switch with an Output
@cindex @option{-gnateG} (@command{gcc})
Save result of preprocessing in a text file.
-@item -gnateInnn
+@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
-unit to compile is nnn. nnn needs to be a positive number and need to
-be a valid index in the multi-unit source.
+unit to compile is @var{nnn}. @var{nnn} needs to be a positive number and need
+to be a valid index in the multi-unit source.
@item -gnatem=@var{path}
@cindex @option{-gnatem} (@command{gcc})
-- Child unit in a with clause
Change_Selected_Component_To_Expanded_Name (Name (N));
+
+ -- If this is a child unit without a spec, and it has benn analyzed
+ -- already, a declaration has been created for it. The with_clause
+ -- must reflect the actual body, and not the generated declaration,
+ -- to prevent spurious binding errors involving an out-of-date spec.
+ -- Note that this can only happen if the unit includes more than one
+ -- with_clause for the child unit (e.g. in separate subunits).
+
+ if Unit_Kind = N_Subprogram_Declaration
+ and then Analyzed (Library_Unit (N))
+ and then not Comes_From_Source (Library_Unit (N))
+ then
+ Set_Library_Unit (N,
+ Cunit (Get_Source_Unit (Corresponding_Body (U))));
+ end if;
end if;
-- Restore style checks and restrictions