diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-02-06 11:13:51 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-02-06 11:13:51 +0100 |
commit | d2a6bd6bb570c3ece919323e9a01fe3c2beec08d (patch) | |
tree | 0a39ca01b439decf89f4eef569e3dd4cf7ff86f2 /gcc/ada/checks.adb | |
parent | 4c7e09908b732b93b74b49ad3eafda0198c1d1df (diff) | |
download | gcc-d2a6bd6bb570c3ece919323e9a01fe3c2beec08d.zip gcc-d2a6bd6bb570c3ece919323e9a01fe3c2beec08d.tar.gz gcc-d2a6bd6bb570c3ece919323e9a01fe3c2beec08d.tar.bz2 |
[multiple changes]
2013-02-06 Ed Schonberg <schonberg@adacore.com>
* checks.adb (Apply_Discriminant_Check): Look for discriminant
constraint in full view of private type when needed.
* sem_ch12.adb (Validate_Array_Type_Instance): Specialize
previous patch to components types that are private and without
discriminants.
2013-02-06 Hristian Kirtchev <kirtchev@adacore.com>
* exp_ch4.adb (Find_Enclosing_Context): Recognize
a simple return statement as one of the cases that require special
processing with respect to temporary controlled function results.
(Process_Transient_Object): Do attempt to finalize a temporary
controlled function result when the associated context is
a simple return statement. Instead, leave this task to the
general finalization mechanism.
2013-02-06 Thomas Quinot <quinot@adacore.com>
* einfo.ads: Minor reformatting.
(Status_Flag_Or_Transient_Decl): Add ??? comment.
From-SVN: r195791
Diffstat (limited to 'gcc/ada/checks.adb')
-rw-r--r-- | gcc/ada/checks.adb | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index a0ca4c6..37c6dd1 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2012, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2013, 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- -- @@ -1536,8 +1536,8 @@ package body Checks is -- the constraints are constants. In this case, we can do the check -- successfully at compile time. - -- We skip this check for the case where the node is a rewritten` - -- allocator, because it already carries the context subtype, and + -- We skip this check for the case where the node is a rewritten`as + -- an allocator, because it already carries the context subtype, and -- extracting the discriminants from the aggregate is messy. if Is_Constrained (S_Typ) @@ -1591,7 +1591,17 @@ package body Checks is end if; end if; - DconT := First_Elmt (Discriminant_Constraint (T_Typ)); + -- Constraint may appear in full view of type + + if Ekind (T_Typ) = E_Private_Subtype + and then Present (Full_View (T_Typ)) + then + DconT := + First_Elmt (Discriminant_Constraint (Full_View (T_Typ))); + + else + DconT := First_Elmt (Discriminant_Constraint (T_Typ)); + end if; while Present (Discr) loop ItemS := Node (DconS); |