aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch13.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-07-30 12:47:17 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-07-30 12:47:17 +0200
commitac072cb2f4dd884d48fb7527cadf2aa0b1a656d0 (patch)
tree18f7a061ea1bffce8cef6c5638af132a9dcb3ded /gcc/ada/sem_ch13.adb
parentcc6f5d75edd7727c9453cdfab4f03ae84b099b0a (diff)
downloadgcc-ac072cb2f4dd884d48fb7527cadf2aa0b1a656d0.zip
gcc-ac072cb2f4dd884d48fb7527cadf2aa0b1a656d0.tar.gz
gcc-ac072cb2f4dd884d48fb7527cadf2aa0b1a656d0.tar.bz2
[multiple changes]
2014-07-30 Robert Dewar <dewar@adacore.com> * 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 <dewar@adacore.com> * sem_ch13.adb (Analyze_Aspect, predicate cases): Diagnose use of predicate aspect on entity other than a type. 2014-07-30 Ed Schonberg <schonberg@adacore.com> * 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
Diffstat (limited to 'gcc/ada/sem_ch13.adb')
-rw-r--r--gcc/ada/sem_ch13.adb9
1 files changed, 9 insertions, 0 deletions
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.