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

[Ada] Plug legality loophole for equality operator of untagged record types

In Ada 2012, the RM 4.5.2(9.8) clause prevents an equality operator for an
untagged record type from being declared after the type is frozen.  While
the clause is implemented in GNAT, the implementation has a loophole which
lets subprogram bodies that are not the completion of a declaration pass
the check without being flagged.

gcc/ada/

	* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Set Acts_As_Spec
	earlier if the body is not the completion of a declaration.
	(Check_Untagged_Equality): Deal with subprogram bodies that are
	not the completion of a declaration and make sure that they are
	not flagged when they cause the freezing of the type themselves.
	Give a warning on the freezing point of the type in more cases.
	* sem_res.adb (Resolve_Equality_Op): Revert latest change.
parent b872d3fe
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