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] Reject properly an aspect Predicate on a formal type


This patch adds a check to reject an aspect Predicate on a formal type
declaration.

Compiling gen.adb must yield:

   gen.ads:2:55: predicate cannot apply to formal type

---
generic
   type T is array (Integer range <>) of Integer
       with Predicate => T'First /= 1;
function Gen return Integer;
---
function Gen return Integer is
   X : T(1 .. 2);
begin
   return X'First;
end Gen;

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

2017-12-05  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch13.adb (Analyze_Aspect_Specifications, case Predicate): A
	predicate cannot apply to a formal type.

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]