aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-10-17 11:11:14 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-10-17 11:11:14 +0200
commitac2ea5c51351f4b4b27f4f81e078198b55bcd410 (patch)
tree9ee5f817a683d0157c79b91d46374083b7c80f46 /gcc
parent99425ec329df4fa7d48f34803efd901284267197 (diff)
downloadgcc-ac2ea5c51351f4b4b27f4f81e078198b55bcd410.zip
gcc-ac2ea5c51351f4b4b27f4f81e078198b55bcd410.tar.gz
gcc-ac2ea5c51351f4b4b27f4f81e078198b55bcd410.tar.bz2
[multiple changes]
2014-10-17 Ed Schonberg <schonberg@adacore.com> * exp_ch3.adb (Build_Component_Invariant_Call): Retrieve Invariant subprogram from base type. * sem_ch7.adb (Analyze_Package_Specification): Build invariant subprogram for private type, not any of its subtypes. * sem_ch13.adb (Build_Invariant_Procedure_Declaration): Set type of procedure entity, because a call to it may be generated in a client unit before the corresponding subprogram declaration is analyzed. 2014-10-17 Vincent Celier <celier@adacore.com> * prj-nmsc.adb (Get_Directories): Do not create directories when a project is abstract. 2014-10-17 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Iterator_Specification): If the domain of iteration is given by an expression that is not an array type, verify that its type implements an iterator iterface. From-SVN: r216380
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog22
-rw-r--r--gcc/ada/exp_ch3.adb4
-rw-r--r--gcc/ada/prj-nmsc.adb6
-rw-r--r--gcc/ada/sem_ch13.adb2
-rw-r--r--gcc/ada/sem_ch5.adb11
-rw-r--r--gcc/ada/sem_ch7.adb6
6 files changed, 47 insertions, 4 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 7ae4ea2..63cf230 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,25 @@
+2014-10-17 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_ch3.adb (Build_Component_Invariant_Call): Retrieve Invariant
+ subprogram from base type.
+ * sem_ch7.adb (Analyze_Package_Specification): Build invariant
+ subprogram for private type, not any of its subtypes.
+ * sem_ch13.adb (Build_Invariant_Procedure_Declaration): Set type
+ of procedure entity, because a call to it may be generated in
+ a client unit before the corresponding subprogram declaration
+ is analyzed.
+
+2014-10-17 Vincent Celier <celier@adacore.com>
+
+ * prj-nmsc.adb (Get_Directories): Do not create directories
+ when a project is abstract.
+
+2014-10-17 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch5.adb (Analyze_Iterator_Specification): If the domain
+ of iteration is given by an expression that is not an array type,
+ verify that its type implements an iterator iterface.
+
2014-10-17 Robert Dewar <dewar@adacore.com>
* sem_attr.adb (Eval_Attribute): Ensure that attribute
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index 837e58f..dd6d34e 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -3720,10 +3720,12 @@ package body Exp_Ch3 is
end if;
end if;
+ -- The aspect is type-specific, so retrieve it from the base type.
+
Call :=
Make_Procedure_Call_Statement (Loc,
Name =>
- New_Occurrence_Of (Invariant_Procedure (Typ), Loc),
+ New_Occurrence_Of (Invariant_Procedure (Base_Type (Typ)), Loc),
Parameter_Associations => New_List (Sel_Comp));
if Is_Access_Type (Etype (Comp)) then
diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb
index 93b5963b..0e0117a 100644
--- a/gcc/ada/prj-nmsc.adb
+++ b/gcc/ada/prj-nmsc.adb
@@ -5498,13 +5498,15 @@ package body Prj.Nmsc is
Dir_Exists : Boolean;
No_Sources : constant Boolean :=
- ((not Source_Files.Default
+ Project.Qualifier = Abstract_Project
+ or else
+ (((not Source_Files.Default
and then Source_Files.Values = Nil_String)
or else (not Source_Dirs.Default
and then Source_Dirs.Values = Nil_String)
or else (not Languages.Default
and then Languages.Values = Nil_String))
- and then Project.Extends = No_Project;
+ and then Project.Extends = No_Project);
-- Start of processing for Get_Directories
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index b486a68..71442ae 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -3903,6 +3903,7 @@ package body Sem_Ch13 is
if Ctrl = Ent
or else Ctrl = Class_Wide_Type (Ent)
+
or else
(Ekind (Ctrl) = E_Anonymous_Access_Type
and then
@@ -7393,6 +7394,7 @@ package body Sem_Ch13 is
Chars => New_External_Name (Chars (Typ), "Invariant"));
Set_Has_Invariants (Typ);
Set_Ekind (SId, E_Procedure);
+ Set_Etype (SId, Standard_Void_Type);
Set_Is_Invariant_Procedure (SId);
Set_Invariant_Procedure (Typ, SId);
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index 22d11b0..c8d27f1 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -1838,6 +1838,17 @@ package body Sem_Ch5 is
else
Typ := Etype (Iter_Name);
+
+ -- Verify that the expression produces an iterator.
+
+ if not Of_Present (N) and then not Is_Iterator (Typ)
+ and then not Is_Array_Type (Typ)
+ and then No (Find_Aspect (Typ, Aspect_Iterable))
+ then
+ Error_Msg_N
+ ("expect object that implements iterator interface",
+ Iter_Name);
+ end if;
end if;
-- Protect against malformed iterator
diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb
index 2d96314..bfbf858 100644
--- a/gcc/ada/sem_ch7.adb
+++ b/gcc/ada/sem_ch7.adb
@@ -1384,7 +1384,11 @@ package body Sem_Ch7 is
end if;
if Has_Invariants (E) then
- Build_Invariant_Procedure (E, N);
+ if Ekind (E) = E_Private_Subtype then
+ null;
+ else
+ Build_Invariant_Procedure (E, N);
+ end if;
end if;
end if;