[Ada] Incorrect accessibility checks on functions calls

Pierre-Marie de Rodat derodat@adacore.com
Wed Jun 10 13:35:39 GMT 2020


This patch corrects an issue whereby the compiler would issue incorrect
accessibility errors and checks for objects initialized by functions
returning anonymous access types or type conversions where the operand
is a function returning an anonymous access type.

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

2020-06-10  Justin Squirek  <squirek@adacore.com>

gcc/ada/

	* exp_ch3.adb (Expand_N_Object_Declaration): Add condition to
	handle processing of objects initialized by a call to a function
	return an anonymous access type.
	* exp_ch6.adb, exp_ch6.ads
	(Has_Unconstrained_Access_Discriminants): Moved to sem_util.adb
	(Needs_Result_Accessibility_Level): Moved to sem_util.adb
	* sem_util.adb, sem_util.ads
	(Has_Unconstrained_Access_Discriminants): Moved from exp_ch6.adb
	(Needs_Result_Accessibility_Level): Moved from exp_ch6.adb
	* sem_res.adb (Valid_Conversion): Add condition for the special
	case where the operand of a conversion is the result of an
	anonymous access type
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 18830 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200610/50165965/attachment-0001.bin>


More information about the Gcc-patches mailing list