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] Attribute 'Old should only be used in postconditions


Forbid the use of attribute 'Old outside of postconditions, as required in
Ada 2012. Similarly as for 'Result, it may also be used in Ensures clauses
of test cases and contract cases attached to the subprogram. There is no need
anymore to detect specially references to local variables, which would be
rejected anyway in the context in which preconditions and postconditions are
analyzed.

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

2012-06-26  Yannick Moy  <moy@adacore.com>

	* sem_attr.adb (Analyze_Attribute): Detect if 'Old is used outside a
	postcondition, and issue an error in such a case.

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]