From: Eric Botcazou <[email protected]>
The compiler takes the Entity of a node without checking that it may.
gcc/ada/ChangeLog:
* sem_ch13.adb (Resolve_Aspect_Aggregate.Resolve_Operation): Add
missing guard for the presence of Entity on the node.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/sem_ch13.adb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 0be8f323691..a08b13445db 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -18235,7 +18235,9 @@ package body Sem_Ch13 is
begin
if not Is_Overloaded (Subp_Id) then
- if not Pred (Entity (Subp_Id)) then
+ if not Is_Entity_Name (Subp_Id)
+ or else not Pred (Entity (Subp_Id))
+ then
Error_Msg_NE
("improper aggregate operation for&", Subp_Id, Typ);
end if;
--
2.53.0