aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2016-10-12 10:38:17 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2016-10-12 12:38:17 +0200
commit05662a060a8b17e077c58ce1867fcecf82bd31ff (patch)
tree99fef8818229e014fec01605b8c5b90f46b4d7c9 /gcc/ada
parentd5e7854c12141be936de30092baa3ec49036a02c (diff)
downloadgcc-05662a060a8b17e077c58ce1867fcecf82bd31ff.zip
gcc-05662a060a8b17e077c58ce1867fcecf82bd31ff.tar.gz
gcc-05662a060a8b17e077c58ce1867fcecf82bd31ff.tar.bz2
contracts.adb (Analyze_Contracts): For a type declaration, analyze an iterable aspect when present.
2016-10-12 Ed Schonberg <schonberg@adacore.com> * contracts.adb (Analyze_Contracts): For a type declaration, analyze an iterable aspect when present. From-SVN: r241028
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/contracts.adb17
2 files changed, 22 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 350fc3e..ad188a7 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,10 @@
2016-10-12 Ed Schonberg <schonberg@adacore.com>
+ * contracts.adb (Analyze_Contracts): For a type declaration, analyze
+ an iterable aspect when present.
+
+2016-10-12 Ed Schonberg <schonberg@adacore.com>
+
* sem_ch12.adb (Check_Formal_Package_Instance): Handle properly
an instance of a formal package with defaults, when defaulted
parameters include tagged private types and array types.
diff --git a/gcc/ada/contracts.adb b/gcc/ada/contracts.adb
index c85b650..e26b28d 100644
--- a/gcc/ada/contracts.adb
+++ b/gcc/ada/contracts.adb
@@ -40,6 +40,7 @@ with Sem_Aux; use Sem_Aux;
with Sem_Ch6; use Sem_Ch6;
with Sem_Ch8; use Sem_Ch8;
with Sem_Ch12; use Sem_Ch12;
+with Sem_Ch13; use Sem_Ch13;
with Sem_Disp; use Sem_Disp;
with Sem_Prag; use Sem_Prag;
with Sem_Util; use Sem_Util;
@@ -408,6 +409,22 @@ package body Contracts is
N_Task_Type_Declaration)
then
Analyze_Task_Contract (Defining_Entity (Decl));
+
+ -- For type declarations, we need to do the pre-analysis of
+ -- Iterable aspect specifications.
+ -- Other type aspects need to be resolved here???
+
+ elsif Nkind (Decl) = N_Private_Type_Declaration
+ and then Present (Aspect_Specifications (Decl))
+ then
+ declare
+ E : constant Entity_Id := Defining_Identifier (Decl);
+ It : constant Node_Id := Find_Aspect (E, Aspect_Iterable);
+ begin
+ if Present (It) then
+ Validate_Iterable_Aspect (E, It);
+ end if;
+ end;
end if;
Next (Decl);