summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_strm.adb
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-05 10:49:06 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-05 10:49:06 +0000
commitf05722ee0a2710c7504cd3aae1e156bbb210b35e (patch)
treee49ff40ba730819257273683f54ffa3c90c352a5 /gcc/ada/exp_strm.adb
parent53087cb544c2ee2d6dae2e06e62f4b8472f11833 (diff)
downloadgcc-f05722ee0a2710c7504cd3aae1e156bbb210b35e.tar.gz
2008-08-05 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r138697 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@138698 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_strm.adb')
-rw-r--r--gcc/ada/exp_strm.adb14
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/ada/exp_strm.adb b/gcc/ada/exp_strm.adb
index 2ffa26a4cf9..6f34cae3c4c 100644
--- a/gcc/ada/exp_strm.adb
+++ b/gcc/ada/exp_strm.adb
@@ -1113,12 +1113,22 @@ package body Exp_Strm is
while Present (Discr) loop
Cn := New_External_Name ('C', J);
- Append_To (Decls,
+ Decl :=
Make_Object_Declaration (Loc,
Defining_Identifier => Make_Defining_Identifier (Loc, Cn),
Object_Definition =>
- New_Occurrence_Of (Etype (Discr), Loc)));
+ New_Occurrence_Of (Etype (Discr), Loc));
+
+ -- If this is an access discriminant, do not perform default
+ -- initialization. The discriminant is about to get its value
+ -- from Read, and if the type is null excluding we do not want
+ -- spurious warnings on an initial null value.
+
+ if Is_Access_Type (Etype (Discr)) then
+ Set_No_Initialization (Decl);
+ end if;
+ Append_To (Decls, Decl);
Append_To (Decls,
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Etype (Discr), Loc),