diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-05 15:14:29 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-05 15:14:29 +0000 |
commit | 5efcab60b3e785c320640060c054ae37b5466a12 (patch) | |
tree | 74bd37de7d1d2f235b76bade011fcd2d0d61b9e2 /gcc/ada/sem_ch8.adb | |
parent | 421ce940f3619f98c3afd09ad301d4224ba4ffa4 (diff) | |
download | gcc-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_ch8.adb')
-rw-r--r-- | gcc/ada/sem_ch8.adb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 16c79d99f04..9a19b2a8b1e 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; |