diff options
author | Robert Dewar <dewar@adacore.com> | 2010-08-10 13:50:53 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2010-08-10 15:50:53 +0200 |
commit | b5c739f9f5969b4803b40467822b0b64e0ecd35e (patch) | |
tree | 68d280c8a731b8532d94ecf7f4d3dbceace88a64 /gcc/ada/sem_attr.adb | |
parent | d606f1df142db414d00e0089acb76f4d29caf441 (diff) | |
download | gcc-b5c739f9f5969b4803b40467822b0b64e0ecd35e.zip gcc-b5c739f9f5969b4803b40467822b0b64e0ecd35e.tar.gz gcc-b5c739f9f5969b4803b40467822b0b64e0ecd35e.tar.bz2 |
a-chahan.ads: Add comments on handling of obsolescent entries.
2010-08-10 Robert Dewar <dewar@adacore.com>
* a-chahan.ads: Add comments on handling of obsolescent entries.
* opt.ads: Add Ada_2005 and Ada_2012 renamings for versions.
* restrict.adb (Check_Obsolescent_2005_Entity): New procedure.
* restrict.ads (Check_Obsolescent_2005_Entity): New procedure.
* sem_attr.adb (Analyze_Access_Attribute): Call
Check_Obsolescent_2005_Entity to check for access to obsolescent
Ada.Characters.Handling subprogram.
(Analyze_Attribute, case Class): Applying Class to untagged incomplete
type is obsolescent in Ada 2005.
(Analyze_Attribute, case Constrained): Better placement of flag when
flagged as obsolescent feature.
(Analyze_Attribute, case Storage_Size): Use with tasks is obsolescent
* sem_ch10.adb (Analyze_With_Clause): With of renamings such as Text_IO
is an obsolescent feature.
* sem_ch11.adb (Analyze_Raise_Statement): Numeric_Error is obsolescent
feature.
* sem_ch8.adb (Analyze_Subprogram_Renaming): Call
Check_Obsolescent_2005_Entity to check for renaming obsolete
Ada.Characters.Handling subprogram.
* sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings): Check
for obsolescent restrictions in Ada 2005.
(Analyze_Pragma, case Suppress): Entity arg is obsolescent in Ada 2005
(Analyze_Pragma, case Interface): Interface is obsolescent in Ada 2005
* sem_res.adb (Resolve_Call): Call Check_Obsolescent_2005_Entity to
check for obsolescent references to Ada.Characters.Handling subprograms
2010-08-10 Robert Dewar <dewar@adacore.com>
* einfo.adb, einfo.ads: Fix bad -gnatdt output for incomplete type.
2010-08-10 Robert Dewar <dewar@adacore.com>
* errout.ads: Add VMS table entries for 2005, 12, 2012 switches
* par-ch4.adb: Change wording of Ada 2012 messages
* vms_data.ads: Add VMS entries for /2005, /12, /2012
From-SVN: r163063
Diffstat (limited to 'gcc/ada/sem_attr.adb')
-rw-r--r-- | gcc/ada/sem_attr.adb | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 8b5fd13..bbb6a27 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -584,6 +584,10 @@ package body Sem_Attr is Check_For_Eliminated_Subprogram (P, Entity (P)); + -- Check for obsolescent subprogram reference + + Check_Obsolescent_2005_Entity (Entity (P), P); + -- Build the appropriate subprogram type Build_Access_Subprogram_Type (P); @@ -2535,6 +2539,25 @@ package body Sem_Attr is Check_E0; Find_Type (N); + -- Applying Class to untagged incomplete type is obsolescent in Ada + -- 2005. Note that we can't test Is_Tagged_Type here on P_Type, since + -- this flag gets set by Find_Type in this situation. + + if Restriction_Active (No_Obsolescent_Features) + and then Ada_Version >= Ada_2005 + and then Ekind (P_Type) = E_Incomplete_Type + then + declare + DN : constant Node_Id := Declaration_Node (P_Type); + begin + if Nkind (DN) = N_Incomplete_Type_Declaration + and then not Tagged_Present (DN) + then + Check_Restriction (No_Obsolescent_Features, P); + end if; + end; + end if; + ------------------ -- Code_Address -- ------------------ @@ -2612,7 +2635,7 @@ package body Sem_Attr is -- Case from RM J.4(2) of constrained applied to private type if Is_Entity_Name (P) and then Is_Type (Entity (P)) then - Check_Restriction (No_Obsolescent_Features, N); + Check_Restriction (No_Obsolescent_Features, P); if Warn_On_Obsolescent_Feature then Error_Msg_N @@ -4197,6 +4220,10 @@ package body Sem_Attr is if Is_Task_Type (P_Type) then Set_Etype (N, Universal_Integer); + -- Use with tasks is an obsolescent feature + + Check_Restriction (No_Obsolescent_Features, P); + elsif Is_Access_Type (P_Type) then if Ekind (P_Type) = E_Access_Subprogram_Type then Error_Attr_P |