summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch7.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-26 13:12:34 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-26 13:12:34 +0000
commit87f3d5d373fb3d1c0748816a2188c79eb4449289 (patch)
tree8a6ecde825359b408b09247b4efe229b7d9826f1 /gcc/ada/sem_ch7.adb
parent672ca3bb6bfa77428fc02998d6424f82b0e4abf5 (diff)
downloadgcc-87f3d5d373fb3d1c0748816a2188c79eb4449289.tar.gz
2010-10-26 Robert Dewar <dewar@adacore.com>
* sem_ch13.adb (Build_Invariant_Procedure): New calling sequence. (Build_Invariant_Procedure): Properly handle analysis of invariant expression with proper end-of-visible-decls visibility. * sem_ch13.ads (Build_Invariant_Procedure): Changed calling sequence. * sem_ch3.adb (Process_Full_View): Don't build invariant procedure (too late). (Analyze_Private_Extension_Declaration): Propagate invariant flags. * sem_ch7.adb (Analyze_Package_Specification): Build invariant procedures. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165960 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch7.adb')
-rw-r--r--gcc/ada/sem_ch7.adb12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb
index e9f9facaf44..b769357dd80 100644
--- a/gcc/ada/sem_ch7.adb
+++ b/gcc/ada/sem_ch7.adb
@@ -1128,16 +1128,26 @@ package body Sem_Ch7 is
Analyze_Declarations (Vis_Decls);
end if;
- -- Verify that incomplete types have received full declarations
+ -- Verify that incomplete types have received full declarations and
+ -- also build invariant procedures for any types with invariants.
E := First_Entity (Id);
while Present (E) loop
+
+ -- Check on incomplete types
+
if Ekind (E) = E_Incomplete_Type
and then No (Full_View (E))
then
Error_Msg_N ("no declaration in visible part for incomplete}", E);
end if;
+ -- Build invariant procedures
+
+ if Is_Type (E) and then Has_Invariants (E) then
+ Build_Invariant_Procedure (E, N);
+ end if;
+
Next_Entity (E);
end loop;