aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch3.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2016-04-27 15:05:41 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2016-04-27 15:05:41 +0200
commit680d5f6190bf5c90e600f47ee8c9e604d80b2f7b (patch)
treeced0897ff6a0f85f50870e91078f0df69a7eedf0 /gcc/ada/sem_ch3.adb
parent14f3895c40cd3f074ca17823c30a6cbf665836b5 (diff)
downloadgcc-680d5f6190bf5c90e600f47ee8c9e604d80b2f7b.zip
gcc-680d5f6190bf5c90e600f47ee8c9e604d80b2f7b.tar.gz
gcc-680d5f6190bf5c90e600f47ee8c9e604d80b2f7b.tar.bz2
[multiple changes]
2016-04-27 Ed Schonberg <schonberg@adacore.com> * sem_util.ads, sem_util.adb (Is_Null_Record_Type): New predicate to determine whether a record type is a null record. * sem_ch3.adb (Analyze_Object_Declaration): If the type is a null record and there is no expression in the declaration, no predicate check applies to the object. 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch7.adb (Analyze_Package_Body_Helper): The body of an instantiated package should not cause freezing of previous contracts. 2016-04-27 Ed Schonberg <schonberg@adacore.com> * sem_dim.adb (Analyze_Dimension): Handle subtype declarations that do not come from source. (Analyze_Dimension_Subtype_Declaration): Allow confirming dimensions on subtype entity, either inherited from base type or provided by aspect specification. 2016-04-27 Ed Schonberg <schonberg@adacore.com> * s-gearop.ads (Matrix_Vector_Solution, Matrix_Matrix_Solution): Add scalar formal object Zero, to allow detection and report when the matrix is singular. * s-gearop.adb (Matrix_Vector_Solution, Matrix_Matrix_Solution): Raise Constraint_Error if the Forward_Eliminate pass has determined that determinant is Zero.o * s-ngrear.adb (Solve): Add actual for Zero in corresponding instantiations. * s-ngcoar.adb (Solve): Ditto. From-SVN: r235499
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r--gcc/ada/sem_ch3.adb16
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index cde4d1a..c9aa9d6 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -3835,8 +3835,16 @@ package body Sem_Ch3 is
Check_Expression_Against_Static_Predicate (E, T);
end if;
- Insert_After (N,
- Make_Predicate_Check (T, New_Occurrence_Of (Id, Loc)));
+ -- If the type is a null record and there is no explicit initial
+ -- expression, no predicate check applies.
+
+ if No (E) and then Is_Null_Record_Type (T) then
+ null;
+
+ else
+ Insert_After (N,
+ Make_Predicate_Check (T, New_Occurrence_Of (Id, Loc)));
+ end if;
end if;
-- Case of unconstrained type
@@ -13039,7 +13047,7 @@ package body Sem_Ch3 is
procedure Fixup_Bad_Constraint;
-- Called after finding a bad constraint, and after having posted an
-- appropriate error message. The goal is to leave type Def_Id in as
- -- reasonable state as possiblet.
+ -- reasonable state as possible.
--------------------------
-- Fixup_Bad_Constraint --
@@ -13112,7 +13120,7 @@ package body Sem_Ch3 is
and then Nkind (Parent (S)) = N_Subtype_Declaration
and then not Is_Itype (Def_Id)
then
- -- A little sanity check, emit an error message if the type has
+ -- A little sanity check: emit an error message if the type has
-- discriminants to begin with. Type T may be a regular incomplete
-- type or imported via a limited with clause.