From ac072cb2f4dd884d48fb7527cadf2aa0b1a656d0 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Wed, 30 Jul 2014 12:47:17 +0200 Subject: [multiple changes] 2014-07-30 Robert Dewar * sem_ch4.adb (Analyze_If_Expression): Resolve condition before analyzing branches. * sem_eval.adb (Out_Of_Range): Check for statically unevaluated expression case. 2014-07-30 Robert Dewar * sem_ch13.adb (Analyze_Aspect, predicate cases): Diagnose use of predicate aspect on entity other than a type. 2014-07-30 Ed Schonberg * sem_ch6.adb (Body_Has_Contract): New predicate to determine when a subprogram body without a previous spec cannot be inlined in GNATprove mode, because it includes aspects or pragmas that generate a SPARK contract clause. * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): A subprogram instance cannot be inlined. From-SVN: r213247 --- gcc/ada/sem_ch13.adb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gcc/ada/sem_ch13.adb') diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index c7d039d..f6a8707 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -1778,6 +1778,15 @@ package body Sem_Ch13 is Aspect_Predicate | Aspect_Static_Predicate => + -- These aspects apply only to subtypes + + if not Is_Type (E) then + Error_Msg_N + ("predicate can only be specified for a subtype", + Aspect); + goto Continue; + end if; + -- Construct the pragma (always a pragma Predicate, with -- flags recording whether it is static/dynamic). We also -- set flags recording this in the type itself. -- cgit v1.1