Skip to content
Snippets Groups Projects
Commit 4e8310b3 authored by Eric Botcazou's avatar Eric Botcazou Committed by Pierre-Marie de Rodat
Browse files

[Ada] Do not freeze subprogram body without spec too early

This fixes a small oddity whereby a subprogram body declared without a spec
would be frozen before its entity is fully processed as an overloaded name.
Now the latter step computes useful information, for example whether the
body is a (late) primitive of a tagged type, which can be required during
the freezing process.  The change also adjusts Check_Dispatching_Operation
accordingly.  No functional changes.

gcc/ada/

	* sem_ch6.adb (Analyze_Subprogram_Body_Helper): For the case where
	there is no previous declaration, freeze the body entity only after
	it has been processed as a new overloaded name.
	Use Was_Expression_Function to recognize expression functions.
	* sem_disp.adb (Check_Dispatching_Operation): Do not require a body
	which is the last primitive to be frozen here.
parent ce0bbf28
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