This is the mail archive of the gcc-cvs@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]

r260506 - in /trunk/gcc/ada: ChangeLog sem_ch6.adb


Author: pmderodat
Date: Tue May 22 13:17:22 2018
New Revision: 260506

URL: https://gcc.gnu.org/viewcvs?rev=260506&root=gcc&view=rev
Log:
[Ada] Missing error on illegal categorization dependency

This patch modifies the analysis of subprogram declarations to ensure that an
aspect which is converted into a categorization pragma is properly taken into
account when verifying the dependencies of a subprogram unit.

------------
-- Source --
------------

--  pack.ads

package Pack is end Pack;

--  proc1.ads

with Pack;

procedure Proc1 with Pure;

--  proc2.ads

with Pack;

procedure Proc2;
pragma Pure (Proc2);

----------------------------
-- Compilation and output --
----------------------------

$ gcc -c proc1.ads
$ gcc -c proc2.ads
proc1.ads:1:06: cannot depend on "Pack" (wrong categorization)
proc1.ads:1:06: pure unit cannot depend on non-pure unit
proc2.ads:1:06: cannot depend on "Pack" (wrong categorization)
proc2.ads:1:06: pure unit cannot depend on non-pure unit

2018-05-22  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

	* sem_ch6.adb (Analyze_Subprogram_Declaration): Set the proper
	categorization of the unit after processing the aspects in case one of
	its aspects is converted into a categorization pragma.

Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/sem_ch6.adb


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