From 6dc87f5f53deaabf19384afd42d5dbcad7591be7 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Thu, 21 Apr 2016 10:25:21 +0200 Subject: [multiple changes] 2016-04-21 Hristian Kirtchev * sem_aux.ads, sem_aux.adb (Has_Rep_Item): New variant. * sem_util.adb (Inherit_Rep_Item_Chain): Reimplemented. 2016-04-21 Hristian Kirtchev * exp_ch6.adb: Minor reformatting. 2016-04-21 Ed Schonberg * sem_ch13.adb: Minor comment update. 2016-04-21 Ed Schonberg * freeze.ads, freeze.adb (Freeze_Entity, Freeze_Before): Add boolean parameter to determine whether freezing an overloadable entity freezes its profile as well. This is required by AI05-019. The call to Freeze_Profile within Freeze_Entity is conditioned by the value of this flag, whose default is True. * sem_attr.adb (Resolve_Attribute, case 'Access): The attribute reference freezes the prefix, but it the prefix is a subprogram it does not freeze its profile. From-SVN: r235308 --- gcc/ada/sem_attr.adb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'gcc/ada/sem_attr.adb') diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index e8483b9..099a1b8 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2015, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2016, 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- -- @@ -10161,18 +10161,20 @@ package body Sem_Attr is end loop; -- If Prefix is a subprogram name, this reference freezes, - -- but not if within spec expression mode + -- but not if within spec expression mode. The profile of + -- the subprogram is not frozen at this point. if not In_Spec_Expression then - Freeze_Before (N, Entity (P)); + Freeze_Before (N, Entity (P), False); end if; - -- If it is a type, there is nothing to resolve. If it is an - -- object, complete its resolution. + -- If it is a type, there is nothing to resolve. + -- If it is a subprogram, do not freeze its profile. + -- If it is an object, complete its resolution. elsif Is_Overloadable (Entity (P)) then if not In_Spec_Expression then - Freeze_Before (N, Entity (P)); + Freeze_Before (N, Entity (P), False); end if; -- Nothing to do if prefix is a type name -- cgit v1.1