diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-02 14:26:47 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-02 14:26:47 +0200 |
commit | 12f0c50ca93bed7c589750e20df7977787e0ea07 (patch) | |
tree | e9994213bbdf660c6dabde2c267fe268880d00c1 /gcc/ada/sem_res.adb | |
parent | fb86fe11bfa9d28396b7283c41f8da190e205934 (diff) | |
download | gcc-12f0c50ca93bed7c589750e20df7977787e0ea07.zip gcc-12f0c50ca93bed7c589750e20df7977787e0ea07.tar.gz gcc-12f0c50ca93bed7c589750e20df7977787e0ea07.tar.bz2 |
[multiple changes]
2011-08-02 Geert Bosch <bosch@adacore.com>
* a-calfor.adb (Image): Simplify, removing unnecessary uses of 'Image.
2011-08-02 Eric Botcazou <ebotcazou@adacore.com>
* sem_type.adb (Covers): Move trivial case to the top and reuse the
computed value of Base_Type.
2011-08-02 Yannick Moy <moy@adacore.com>
* restrict.adb (Check_Restriction): issue an error for any use of
class-wide, even if the No_Dispatch restriction is not set.
* sem_aggr.adb: Correct typos in comments and messages in formal mode
* sem_ch3.adb (Process_Full_View): issue an error in formal mode is,
when completing a private extension, the type named in the private part
is not the same as that named in the visible part.
* sem_res.adb (Resolve_Call): issue an error in formal mode on the use
of an inherited primitive operations of a tagged type or type extension
that returns the tagged type.
* sem_util.adb, sem_util.ads (Is_Inherited_Operation_For_Type): new
function which returns True for an implicit operation inherited by the
derived type declaration for the argument type.
(Is_SPARK_Object_Reference): move to appropriate place in alphabetic
order.
From-SVN: r177135
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r-- | gcc/ada/sem_res.adb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 22234c8..00115cc 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -5734,6 +5734,22 @@ package body Sem_Res is Check_For_Eliminated_Subprogram (Subp, Nam); end if; + -- In formal mode, the primitive operations of a tagged type or type + -- extension do not include functions that return the tagged type. + + -- Commented out as the call to Is_Inherited_Operation_For_Type may + -- cause an error because the type entity of the parent node of + -- Entity (Name (N) may not be set. + +-- if Nkind (N) = N_Function_Call +-- and then Is_Tagged_Type (Etype (N)) +-- and then Is_Entity_Name (Name (N)) +-- and then Is_Inherited_Operation_For_Type +-- (Entity (Name (N)), Etype (N)) +-- then +-- Check_Formal_Restriction ("function not inherited", N); +-- end if; + -- All done, evaluate call and deal with elaboration issues Eval_Call (N); |