[Ada] Protect analysis of Indexing aspect against cascaded errors

2019-08-13  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* sem_ch13.adb (Check_Iterator_Functions): Protect against
	cascaded errors.

From-SVN: r274351
This commit is contained in:
Arnaud Charlet 2019-08-13 08:08:01 +00:00 committed by Pierre-Marie de Rodat
parent 9e42b1920b
commit aa1b718b76
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2019-08-13 Arnaud Charlet <charlet@adacore.com>
* sem_ch13.adb (Check_Iterator_Functions): Protect against
cascaded errors.
2019-08-13 Ed Schonberg <schonberg@adacore.com>
* sem_ch8.adb (Analyze_Subprogram_Renaming): Do no suppress mode

View File

@ -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.