[COMMITTED] ada: Fix another case of missing Has_Private_View flag

Message ID 20230613073827.240259-1-poulhies@adacore.com
State Committed
Commit d0ffa8d5155db105ce7b6e5b76c489c0fff1d090
Headers
Series [COMMITTED] ada: Fix another case of missing Has_Private_View flag |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gcc_check--master-arm fail Patch failed to apply

Commit Message

Marc Poulhiès June 13, 2023, 7:38 a.m. UTC
  From: Eric Botcazou <ebotcazou@adacore.com>

It occurs for the case of a function call first parsed as an identifier.

gcc/ada/

	* sem_ch12.adb (Save_References_In_Identifier): In the case where
	the identifier has been turned into a function call by analysis,
	call Set_Global_Type on the entity if it is global.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/sem_ch12.adb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 0ef894e153b..a38ab284ce7 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -16526,7 +16526,7 @@  package body Sem_Ch12 is
                   E := Entity (Name (N2));
 
                   if Present (E) and then Is_Global (E) then
-                     Set_Etype (N, Etype (N2));
+                     Set_Global_Type (N, N2);
                   else
                      Set_Associated_Node (N, Empty);
                      Set_Etype (N, Empty);