diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/libgnat/g-dirope.adb | 1 | ||||
-rw-r--r-- | gcc/ada/libgnat/g-dirope.ads | 3 | ||||
-rw-r--r-- | gcc/ada/sem_ch11.adb | 7 |
3 files changed, 5 insertions, 6 deletions
diff --git a/gcc/ada/libgnat/g-dirope.adb b/gcc/ada/libgnat/g-dirope.adb index 127f6ba..3cebc9f 100644 --- a/gcc/ada/libgnat/g-dirope.adb +++ b/gcc/ada/libgnat/g-dirope.adb @@ -636,7 +636,6 @@ package body GNAT.Directory_Operations is if not Is_Open (Dir) then Free (Dir); - Dir := Null_Dir; raise Directory_Error; end if; end Open; diff --git a/gcc/ada/libgnat/g-dirope.ads b/gcc/ada/libgnat/g-dirope.ads index a3a8e46..cdb99ff 100644 --- a/gcc/ada/libgnat/g-dirope.ads +++ b/gcc/ada/libgnat/g-dirope.ads @@ -210,8 +210,7 @@ package GNAT.Directory_Operations is procedure Open (Dir : out Dir_Type; Dir_Name : Dir_Name_Str); -- Opens the directory named by Dir_Name and returns a Dir_Type value -- that refers to this directory, and is positioned at the first entry. - -- Raises Directory_Error if Dir_Name cannot be accessed. In that case - -- Dir will be set to Null_Dir. + -- Raises Directory_Error if Dir_Name cannot be accessed. procedure Close (Dir : in out Dir_Type); -- Closes the directory stream referred to by Dir. After calling Close diff --git a/gcc/ada/sem_ch11.adb b/gcc/ada/sem_ch11.adb index 5471111..73eca7a 100644 --- a/gcc/ada/sem_ch11.adb +++ b/gcc/ada/sem_ch11.adb @@ -543,11 +543,12 @@ package body Sem_Ch11 is if Present (P) and then Nkind (P) = N_Assignment_Statement then L := Name (P); - -- Give warning for assignment to scalar formal + -- Give warning for assignment to by-copy formal - if Is_Scalar_Type (Etype (L)) - and then Is_Entity_Name (L) + if Is_Entity_Name (L) and then Is_Formal (Entity (L)) + and then Is_By_Copy_Type (Etype (L)) + and then not Is_Aliased (Entity (L)) -- Do this only for parameters to the current subprogram. -- This avoids some false positives for the nested case. |