From 5e127570e2871666c51d6c27a05cc3297030a823 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Fri, 6 Jan 2017 12:22:32 +0100 Subject: [multiple changes] 2017-01-06 Justin Squirek * sem_attr.adb (Analyze_Attribute): Modify semantic checks for Finalization_Size to allow a prefix of any non-class-wide type. * sem_attr.ads Modify comment for Finalization_Size to include definite type use case. 2017-01-06 Ed Schonberg * einfo.ads, einfo.adb (Is_Entry_Wrapper): New flag, defined on procedures that are wrappers created for entries that have preconditions. * sem_ch6.adb (Analyze_Subrogram_Body_Helper): If the subprogram body is an entry_wrapper, compile it in the context of the synchronized type, because a precondition may refer to funtions of the type. * exp_ch9.adb (Build_Contract_Wrapper): Set Is_Entry_Wrapper on body entity. * exp_ch6.adb (Expand_Protected_Subprogram_Call): if the call is within an Entry_Wrapper this is an external call whose target is the synchronized object that is the actual in the call to the wrapper. From-SVN: r244138 --- gcc/ada/sem_attr.adb | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'gcc/ada/sem_attr.adb') diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 188872e..8d88338 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -3839,8 +3839,27 @@ package body Sem_Attr is when Attribute_Finalization_Size => Check_E0; - Analyze_And_Resolve (P); - Check_Object_Reference (P); + + if Is_Object_Reference (P) then + Analyze_And_Resolve (P); + Check_Object_Reference (P); + + -- Redundant type verification for accurate error output + + elsif not Is_Entity_Name (P) + or else not Is_Type (Entity (P)) + then + Error_Attr_P ("prefix of % attribute must be a definite type or" & + " an object"); + else + Check_Type; + Check_Not_Incomplete_Type; + if Is_Class_Wide_Type (Etype (P)) then + Error_Attr_P ("prefix of % attribute cannot be applied to " & + "a class-wide type"); + end if; + end if; + Set_Etype (N, Universal_Integer); ----------- -- cgit v1.1