aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2008-08-05 17:14:29 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2008-08-05 17:14:29 +0200
commitaecf0203034942824ef2b4d1b30d168f6b595491 (patch)
tree74bd37de7d1d2f235b76bade011fcd2d0d61b9e2
parent1f1aa84f063d166ac95f7bfbcf039a6f7592dfe7 (diff)
downloadgcc-aecf0203034942824ef2b4d1b30d168f6b595491.zip
gcc-aecf0203034942824ef2b4d1b30d168f6b595491.tar.gz
gcc-aecf0203034942824ef2b4d1b30d168f6b595491.tar.bz2
sem_ch3.adb (Process_Subtype): An allocator is a valid construct that can carry a null exclusion indicator...
2008-08-05 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Process_Subtype): An allocator is a valid construct that can carry a null exclusion indicator, and on which an error may be posted if the indicator is redundant. * sem_ch8.adb (Analyze_Object_Renaming): Verify that a null exclusion does not apply to a subtype mark that already excludes null. * sem_ch12.adb (Formal_Object_Declaration): Verify that a null exclusion does not apply to a subtype mark that already excludes null. From-SVN: r138728
-rw-r--r--gcc/ada/ChangeLog24
-rw-r--r--gcc/ada/sem_ch12.adb10
-rw-r--r--gcc/ada/sem_ch3.adb5
-rw-r--r--gcc/ada/sem_ch8.adb5
4 files changed, 44 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index a0b29ac..761c5da 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,27 @@
+2008-08-05 Ed Schonberg <schonberg@adacore.com>
+
+ * freeze.adb:
+ (Freeze_Entity): A deferred constant does not violate the restriction
+ No_Default_Initialization,
+
+ * sem_ch3.adb (Process_Subtype): An allocator is a valid construct that
+ can carry a null exclusion indicator, and on which an error may be
+ posted if the indicator is redundant.
+
+ * sem_ch8.adb (Analyze_Object_Renaming): Verify that a null exclusion
+ does not apply to a subtype mark that already excludes null.
+
+ * sem_ch12.adb (Formal_Object_Declaration): Verify that a null
+ exclusion does not apply to a subtype mark that already excludes null.
+
+2008-08-05 Thomas Quinot <quinot@adacore.com>
+
+ * Makefile.rtl: Compile s-oscons.ads as part of the runtime library.
+
+2008-08-05 Doug Rupp <rupp@adacore.com>
+
+ * vms_data.ads: Translation for /POINTER_SIZE qualifier.
+
2008-08-05 Thomas Quinot <quinot@adacore.com>
* gsocket.h: Make this file includable in a Nucleus environment, which
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index dc23dde..82b47aa 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -1810,6 +1810,16 @@ package body Sem_Ch12 is
Find_Type (Subtype_Mark (N));
T := Entity (Subtype_Mark (N));
+ -- Verify that there is no redundant null exclusion.
+
+ if Null_Exclusion_Present (N)
+ and then Can_Never_Be_Null (T)
+ then
+ Error_Msg_NE
+ ("`NOT NULL` not allowed (& already excludes null)",
+ N, T);
+ end if;
+
-- Ada 2005 (AI-423): Formal object with an access definition
else
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 3720b3b..8a44655 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -16507,7 +16507,9 @@ package body Sem_Ch3 is
or else
Nkind_In (P, N_Derived_Type_Definition,
N_Discriminant_Specification,
+ N_Formal_Object_Declaration,
N_Object_Declaration,
+ N_Object_Renaming_Declaration,
N_Parameter_Specification,
N_Subtype_Declaration);
@@ -16552,6 +16554,9 @@ package body Sem_Ch3 is
Error_Node :=
Subtype_Indication (Component_Definition (Related_Nod));
+ when N_Allocator =>
+ Error_Node := Expression (Related_Nod);
+
when others =>
pragma Assert (False);
Error_Node := Related_Nod;
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index 16c79d9..9a19b2a 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -884,6 +884,11 @@ package body Sem_Ch8 is
Error_Msg_N
("renamed object does not exclude `NULL` "
& "(RM 8.5.1(4.6/2))", N);
+
+ elsif Can_Never_Be_Null (Etype (Nam_Ent)) then
+ Error_Msg_NE
+ ("`NOT NULL` not allowed (type of& already excludes null)",
+ N, Nam_Ent);
end if;
end if;
end;