aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_intr.adb
diff options
context:
space:
mode:
authorThomas Quinot <quinot@adacore.com>2005-11-15 14:58:22 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2005-11-15 14:58:22 +0100
commit191cab8dcf49ea0837da9eb138516e1ce7ffa7cf (patch)
treecdab281021e660fa90e4db3583dabce0806d6892 /gcc/ada/sem_intr.adb
parent65b1b4317c419981d35e0f2c7e71236fd105bc96 (diff)
downloadgcc-191cab8dcf49ea0837da9eb138516e1ce7ffa7cf.zip
gcc-191cab8dcf49ea0837da9eb138516e1ce7ffa7cf.tar.gz
gcc-191cab8dcf49ea0837da9eb138516e1ce7ffa7cf.tar.bz2
exp_intr.adb (Expand_Unc_Deallocation): If GIGI needs an actual subtype to compute the size of the designated object at...
2005-11-14 Thomas Quinot <quinot@adacore.com> Robert Dewar <dewar@adacore.com> Ed Schonberg <schonberg@adacore.com> * exp_intr.adb (Expand_Unc_Deallocation): If GIGI needs an actual subtype to compute the size of the designated object at run-time, create such a subtype and store it in the Actual_Designated_Subtype attribute of the N_Free_Statement. Generate itype for classwide designated object in both cases of user-specified storage pool: specific and class-wide, not only in the specific case. Raise CE when trying to set a not null access type object to null. (Expand_Dispatching_Constructor_Call): Retrieve subprogram actual with an explicit loop, because freeze nodes make its position variable. * sem_intr.adb (Check_Intrinsic_Call): Given warning for freeing not null object. From-SVN: r106976
Diffstat (limited to 'gcc/ada/sem_intr.adb')
-rw-r--r--gcc/ada/sem_intr.adb11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/ada/sem_intr.adb b/gcc/ada/sem_intr.adb
index c7643b3..4362a0e 100644
--- a/gcc/ada/sem_intr.adb
+++ b/gcc/ada/sem_intr.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -132,6 +132,15 @@ package body Sem_Intr is
("argument in call to & must be 31 characters or less", N, Nam);
end if;
+ -- Check for the case of freeing a non-null object which will raise
+ -- Constaint_Error. Issue warning here, do the expansion in Exp_Intr.
+
+ elsif Cnam = Name_Free
+ and then Can_Never_Be_Null (Etype (Arg1))
+ then
+ Error_Msg_N
+ ("freeing `NOT NULL` object will raise Constraint_Error?", N);
+
-- For now, no other special checks are required
else