diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-07 09:12:36 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-07 09:12:36 +0000 |
commit | 1052d1728f0651c14cbe616417d8b6fa4bd8ec19 (patch) | |
tree | 1c6828774f1440e62389af41a529b13b12382b3a /gcc/ada/sem_type.adb | |
parent | 3568e5542f2c0d54d8ad3bc4d429cb2335bcec26 (diff) | |
download | ppe42-gcc-1052d1728f0651c14cbe616417d8b6fa4bd8ec19.tar.gz ppe42-gcc-1052d1728f0651c14cbe616417d8b6fa4bd8ec19.zip |
2010-10-07 Robert Dewar <dewar@adacore.com>
* sem_attr.adb: Minor reformatting.
* einfo.ads, einfo.adb (Is_Ada_2012_Only): New flag
* itypes.adb (Create_Null_Excluding_Itype): Set Is_Ada_2012_Only flag
properly.
* lib-xref.adb (Generate_Reference): Warn on use of Ada 2012 entity in
non-Ada 2012 mode.
* opt.ads (Warn_On_Ada_2012_Compatibility): New flag
* sem_ch3.adb (Analye_Subtype_Declaration): Inherit Is_Ada_2012_Only
* sem_ch7.adb (Preserve_Full_Attributes): Preserve Is_Ada_2012_Only
flag.
* sem_prag.adb (Analyze_Pragma, case Ada_12/Ada_2012): Allow form with
argument.
* sem_type.adb (Disambiguate): Deal with Is_Ada_2012_Only.
* sem_warn.adb (Warn_On_Ada_2012_Compatibility): New flag, treated
same as 2005 flag.
2010-10-07 Javier Miranda <miranda@adacore.com>
* a-tags.ads: Use new support for pragma Ada_2012 with function
Type_Is_Abstract.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165082 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_type.adb')
-rw-r--r-- | gcc/ada/sem_type.adb | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/gcc/ada/sem_type.adb b/gcc/ada/sem_type.adb index ed6c25206c9..b27f446dde8 100644 --- a/gcc/ada/sem_type.adb +++ b/gcc/ada/sem_type.adb @@ -1533,15 +1533,26 @@ package body Sem_Type is It2 := It; Nam2 := It.Nam; + -- Check whether one of the entities is an Ada 2005/2012 and we are + -- operating in an earlier mode, in which case we discard the Ada + -- 2005/2012 entity, so that we get proper Ada 95 overload resolution. + if Ada_Version < Ada_05 then + if Is_Ada_2005_Only (Nam1) or else Is_Ada_2012_Only (Nam1) then + return It2; + elsif Is_Ada_2005_Only (Nam2) or else Is_Ada_2012_Only (Nam1) then + return It1; + end if; + end if; - -- Check whether one of the entities is an Ada 2005 entity and we are - -- operating in an earlier mode, in which case we discard the Ada - -- 2005 entity, so that we get proper Ada 95 overload resolution. + -- Check whether one of the entities is an Ada 2012 entity and we are + -- operating in Ada 2005 mode, in which case we discard the Ada 2012 + -- entity, so that we get proper Ada 2005 overload resolution. - if Is_Ada_2005_Only (Nam1) then + if Ada_Version = Ada_05 then + if Is_Ada_2012_Only (Nam1) then return It2; - elsif Is_Ada_2005_Only (Nam2) then + elsif Is_Ada_2012_Only (Nam2) then return It1; end if; end if; |