diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-01-06 12:22:32 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-01-06 12:22:32 +0100 |
commit | 5e127570e2871666c51d6c27a05cc3297030a823 (patch) | |
tree | ebeb3258b4fb1c6dfdae062c78ba5e192fdef917 /gcc/ada/sem_attr.adb | |
parent | 50145b93899e4a184a20309942255b6e68f206b3 (diff) | |
download | gcc-5e127570e2871666c51d6c27a05cc3297030a823.zip gcc-5e127570e2871666c51d6c27a05cc3297030a823.tar.gz gcc-5e127570e2871666c51d6c27a05cc3297030a823.tar.bz2 |
[multiple changes]
2017-01-06 Justin Squirek <squirek@adacore.com>
* 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 <schonberg@adacore.com>
* 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
Diffstat (limited to 'gcc/ada/sem_attr.adb')
-rw-r--r-- | gcc/ada/sem_attr.adb | 23 |
1 files changed, 21 insertions, 2 deletions
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); ----------- |