gcc/ada/
PR ada/21346
* a-direct.adb (Compose): Containing_Directory can be an empty string.
gcc/testsuite/
PR ada/21346
* gnat.dg/compose.adb: New test.
From-SVN: r130692
when an access to constant is used to initialize an access
value.
+ PR ada/21346
+ * a-direct.adb (Compose): Containing_Directory can be an empty string.
+
2007-12-07 Olivier Hainque <hainque@adacore.com>
PR ada/34173
begin
-- First, deal with the invalid cases
- if not Is_Valid_Path_Name (Containing_Directory) then
+ if Containing_Directory /= ""
+ and then not Is_Valid_Path_Name (Containing_Directory)
+ then
raise Name_Error;
elsif
-- Add a directory separator if needed
- if Result (Last) /= Dir_Separator then
+ if Last /= 0 and then Result (Last) /= Dir_Separator then
Last := Last + 1;
Result (Last) := Dir_Separator;
end if;
* gnat.dg/specs/access_constant_decl.ads: New test.
+ PR ada/21346
+ * gnat.dg/compose.adb: New test.
+
2007-12-07 Olivier Hainque <hainque@adacore.com>
PR ada/34173
--- /dev/null
+-- { dg-do run }
+with Ada.Directories;
+with Ada.Text_IO;
+
+procedure Compose is
+ Result : constant String := Ada.Directories.Compose (Name => "foo",
+ Extension => "txt");
+ pragma Unreferenced (Result);
+begin
+ null;
+end Compose;