r256520 - in /trunk/gcc: ada/ChangeLog ada/sem_...

pmderodat@gcc.gnu.org pmderodat@gcc.gnu.org
Thu Jan 11 08:55:00 GMT 2018


Author: pmderodat
Date: Thu Jan 11 08:55:52 2018
New Revision: 256520

URL: https://gcc.gnu.org/viewcvs?rev=256520&root=gcc&view=rev
Log:
[Ada] Detection of illegal constituent assignments

This patch modifies the analysis of assignment statements to detect an illegal
attempt to alter the value of single protected type Part_Of constituent when
inside a protected function.

2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

	* sem_ch5.adb (Analyze_Assignment): Assignments to variables that act
	as Part_Of consituents of single protected types are illegal when they
	take place inside a protected function.
	(Diagnose_Non_Variable_Lhs): Use Within_Function to check for an
	enclosing function.
	(Is_Protected_Part_Of_Constituent): New routine.
	(Within_Function): New routine.

gcc/testsuite/

	* gnat.dg/protected_func.adb, gnat.dg/protected_func.ads: New testcase.

Added:
    trunk/gcc/testsuite/gnat.dg/protected_func.adb
    trunk/gcc/testsuite/gnat.dg/protected_func.ads
Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/sem_ch5.adb
    trunk/gcc/testsuite/ChangeLog



More information about the Gcc-cvs mailing list