diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-18 09:51:43 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-18 09:51:43 +0000 |
commit | 7de4cba3cf929b5064693a09b6548c50f9e78a51 (patch) | |
tree | 359e3c9b15bfd003219f4e79902aa546b859328a /gcc/ada/exp_strm.adb | |
parent | a88a57739f16e8d09a3c63208765e36fa9867011 (diff) | |
download | gcc-7de4cba3cf929b5064693a09b6548c50f9e78a51.tar.gz |
2014-07-18 Robert Dewar <dewar@adacore.com>
* sem_ch13.adb (Is_Type_Ref): Check that type name is not
parenthesized.
2014-07-18 Vincent Celier <celier@adacore.com>
* s-osinte-vms.ads: Fix style errors.
2014-07-18 Thomas Quinot <quinot@adacore.com>
* s-oscons-tmplt.c (_POSIX_SOURCE): Define in order to get
NAME_MAX and PATH_MAX.
2014-07-18 Bob Duff <duff@adacore.com>
* exp_strm.adb (Build_Record_Or_Elementary_Input_Function,
Build_Record_Or_Elementary_Output_Procedure): For Input and
Output attributes, do not read/write the discriminants if they
have default values; that will be done by Read/Write.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212798 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_strm.adb')
-rw-r--r-- | gcc/ada/exp_strm.adb | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/gcc/ada/exp_strm.adb b/gcc/ada/exp_strm.adb index ce313c6c4b3..288b1bfe30b 100644 --- a/gcc/ada/exp_strm.adb +++ b/gcc/ada/exp_strm.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2013, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2014, 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- -- @@ -1124,7 +1124,10 @@ package body Exp_Strm is J := 1; - if Has_Discriminants (B_Typ) then + if Has_Discriminants (Typ) + and then + No (Discriminant_Default_Value (First_Discriminant (Typ))) + then Discr := First_Discriminant (B_Typ); -- If the prefix subtype is constrained, then retrieve the first @@ -1250,10 +1253,15 @@ package body Exp_Strm is begin Stms := New_List; - -- Note that of course there will be no discriminants for the - -- elementary type case, so Has_Discriminants will be False. + -- Note that of course there will be no discriminants for the elementary + -- type case, so Has_Discriminants will be False. Note that the + -- language rules do not require writing the discriminants in the + -- defaulted case, because those are written by 'Write. - if Has_Discriminants (Typ) then + if Has_Discriminants (Typ) + and then + No (Discriminant_Default_Value (First_Discriminant (Typ))) + then Disc := First_Discriminant (Typ); while Present (Disc) loop |