From: Arnaud Charlet Date: Tue, 13 Aug 2019 08:08:01 +0000 (+0000) Subject: [Ada] Protect analysis of Indexing aspect against cascaded errors X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=aa1b718b769c34f35c66ed11e516a350fc51d547;p=gcc.git [Ada] Protect analysis of Indexing aspect against cascaded errors 2019-08-13 Arnaud Charlet gcc/ada/ * sem_ch13.adb (Check_Iterator_Functions): Protect against cascaded errors. From-SVN: r274351 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index bd3450fffd1..162d027ce73 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2019-08-13 Arnaud Charlet + + * sem_ch13.adb (Check_Iterator_Functions): Protect against + cascaded errors. + 2019-08-13 Ed Schonberg * sem_ch8.adb (Analyze_Subprogram_Renaming): Do no suppress mode diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 4ce248f3d0c..8c5c4243e12 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -4653,10 +4653,12 @@ package body Sem_Ch13 is end if; if not Is_Overloaded (Expr) then - if not Check_Primitive_Function (Entity (Expr)) then + if Entity (Expr) /= Any_Id + and then not Check_Primitive_Function (Entity (Expr)) + then Error_Msg_NE ("aspect Indexing requires a function that applies to type&", - Entity (Expr), Ent); + Entity (Expr), Ent); end if; -- Flag the default_iterator as well as the denoted function.