summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch12.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-05 15:14:29 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-05 15:14:29 +0000
commit5efcab60b3e785c320640060c054ae37b5466a12 (patch)
tree74bd37de7d1d2f235b76bade011fcd2d0d61b9e2 /gcc/ada/sem_ch12.adb
parent421ce940f3619f98c3afd09ad301d4224ba4ffa4 (diff)
downloadgcc-5efcab60b3e785c320640060c054ae37b5466a12.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138728 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch12.adb')
-rw-r--r--gcc/ada/sem_ch12.adb10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index dc23ddea238..82b47aa17a6 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