Skip to content
Snippets Groups Projects
Commit 0d736433 authored by Eric Botcazou's avatar Eric Botcazou Committed by Marc Poulhiès
Browse files

ada: Fix predicate involving array indexing rejected in generic package

The indexing is rejected with the message:

  error: reference to current instance of type does not denote a type

when it is applied to a prefix which is the current instance of the type
to which the predicate is applied.

There is already a specific handling of component selection for this case
present in Find_Selected_Component, so this adds an equivalent specific
handling of indexing for this case to Analyze_Indexed_Component_Form.

gcc/ada/ChangeLog:

	PR ada/117569
	* sem_ch4.adb (Analyze_Indexed_Component_Form): Do not rewrite the
	node as a type conversion if it is the current instance of a type
	in a generic unit.
	* sem_ch8.adb (Find_Selected_Component): Restrict the special case
	of the current instance of a type to a generic unit.
parent 06bc21f4
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment