summaryrefslogtreecommitdiffstats
path: root/gcc/ada/sem_type.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-25 09:34:02 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-25 09:34:02 +0000
commit426bd7d68dd3b474a7d309c94e71ececa16d8bff (patch)
treee33ff61b64fe2dc5c8b03a655de538b8f1d30368 /gcc/ada/sem_type.adb
parent77378d518eb62788e2f759abb1a87a66dfafabaf (diff)
downloadppe42-gcc-426bd7d68dd3b474a7d309c94e71ececa16d8bff.tar.gz
ppe42-gcc-426bd7d68dd3b474a7d309c94e71ececa16d8bff.zip
2009-06-25 Vincent Celier <celier@adacore.com>
* vms_data.ads: Minor comment change 2009-06-25 Gary Dismukes <dismukes@adacore.com> * exp_ch5.adb (Expand_N_Extended_Return_Statement): Don't build an assignment statement to targeting a caller-provided object when the result type is an interface type. * exp_ch6.adb (Expand_Call): Remove redundant test of Is_Limited_Interface (Is_Inherently_Limited is sufficient). (Is_Build_In_Place_Function): Remove test for Is_Limited_Interface. * sem_aggr.adb (Check_Expr_OK_In_Limited_Aggregate): Add type in call to OK_For_Limited_Init. * sem_aux.adb (Is_Inherently_Limited_Type): Revise limited type condition so that True is returned for all limited interfaces, not just synchronized ones. Ignore components of an interface type when checking for limited components (such a component can be a parent component). * sem_ch3.ads (OK_For_Limited_Init_In_05): Add type parameter. (OK_For_Limited_Init): Add type parameter. * sem_ch3.adb (Check_Initialization): Add type in call to OK_For_Limited_Init. (OK_For_Limited_Init): Add new type param in call to OK_For_Limited_Init_In_05. (OK_For_Limited_Init_In_05): Permit arbitrary expressions of a nonlimited type when the context type is a limited interface. Add type on recursive calls. * sem_ch4.adb (Analyze_Allocator): Add type in call to OK_For_Limited_Init. * sem_ch6.adb (Check_Limited_Return): Add type in call to OK_For_Limited_Init. * sem_ch12.adb (Analyze_Formal_Object_Declaration): Add type in call to OK_For_Limited_Init. (Instantiate_Object): Add type in call to OK_For_Limited_Init. * sem_type.adb (Interface_Present_In_Ancestor): In the case of a class-wide interface, get the base type before applying Etype, in order to account for class-wide subtypes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148938 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_type.adb')
-rw-r--r--gcc/ada/sem_type.adb4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/ada/sem_type.adb b/gcc/ada/sem_type.adb
index 0cbce214810..5883e3fe867 100644
--- a/gcc/ada/sem_type.adb
+++ b/gcc/ada/sem_type.adb
@@ -2367,8 +2367,10 @@ package body Sem_Type is
-- Start of processing for Interface_Present_In_Ancestor
begin
+ -- Iface might be a class-wide subtype, so we have to apply Base_Type
+
if Is_Class_Wide_Type (Iface) then
- Iface_Typ := Etype (Iface);
+ Iface_Typ := Etype (Base_Type (Iface));
else
Iface_Typ := Iface;
end if;
OpenPOWER on IntegriCloud