This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Legality checks on constraints for access discriminants.


This patch enforces the following legality rule: If the type of a discriminant
is access_to_variable, a constraint for it cannot be an access_to_constant.
This patch also prevents compiler aborts in illegal programs involving
incomplete types from limited views.
Examples can be found in ACATS B3A0006.

Tested on i686-pc-linux-gnu, committed on trunk

2008-08-06  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch3.adb (Access_Subprogram_Declaration): If the return type is
	incomplete, add the access_to_subprogram type to the list of private
	dependents only if the incomplete type will be completed in the current
	scope.
	(Build_Discriminant_Constraints): If the type of the discriminant is
	access_to_variable, reject a constraint that is access_to_constant.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]