diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-07-29 15:08:12 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-07-29 15:08:12 +0200 |
commit | 02bb07655823135ef3e8b06f63b201bc19f54758 (patch) | |
tree | 2fc7746496fdacb2eb996918ccc599b5a3591c5e /gcc/ada/sem_ch4.adb | |
parent | fc3a3f3b7e04b8249af59cbc6b398ef9518c8cb1 (diff) | |
download | gcc-02bb07655823135ef3e8b06f63b201bc19f54758.zip gcc-02bb07655823135ef3e8b06f63b201bc19f54758.tar.gz gcc-02bb07655823135ef3e8b06f63b201bc19f54758.tar.bz2 |
[multiple changes]
2014-07-29 Robert Dewar <dewar@adacore.com>
* einfo.adb (Has_Protected): Test base type.
* sem_ch4.adb (Analyze_Allocator): Reorganize code to make sure
that we always properly check No_Protected_Type_Allocators.
2014-07-29 Ed Schonberg <schonberg@adacore.com>
* sem_util.ads, sem_util.adb (Defining_Entity): Now applies to
loop declarations as well.
* exp_ch5.adb (Expand_Loop_Statement): Apply Qualify_Entity_Names
to an iterator loop, because it may contain local renaming
declarations that require debugging information.
2014-07-29 Robert Dewar <dewar@adacore.com>
* sem_util.ads, exp_util.adb, sem_attr.adb: Minor reformatting.
From-SVN: r213163
Diffstat (limited to 'gcc/ada/sem_ch4.adb')
-rw-r--r-- | gcc/ada/sem_ch4.adb | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 7f9f086..8ac94e9 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -639,15 +639,6 @@ package body Sem_Ch4 is end; end if; - -- Check restriction against dynamically allocated protected - -- objects. Note that when limited aggregates are supported, - -- a similar test should be applied to an allocator with a - -- qualified expression ??? - - if Has_Protected (Type_Id) then - Check_Restriction (No_Protected_Type_Allocators, N); - end if; - -- Check for missing initialization. Skip this check if we already -- had errors on analyzing the allocator, since in that case these -- are probably cascaded errors. @@ -725,6 +716,12 @@ package body Sem_Ch4 is Check_Restriction (No_Task_Allocators, N); end if; + -- Check restriction against dynamically allocated protected objects + + if Has_Protected (Designated_Type (Acc_Type)) then + Check_Restriction (No_Protected_Type_Allocators, N); + end if; + -- AI05-0013-1: No_Nested_Finalization forbids allocators if the access -- type is nested, and the designated type needs finalization. The rule -- is conservative in that class-wide types need finalization. |