exp_aggr.adb (Build_Record_Aggr_Code): Perform a conversion of the target to the...
authorGary Dismukes <dismukes@adacore.com>
Mon, 4 Aug 2008 10:23:16 +0000 (12:23 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 4 Aug 2008 10:23:16 +0000 (12:23 +0200)
commit05a76b51fb58e10f74e5f4fe613dc5b40fae44d8
treeb867711d776c6a9ac4e1f0d76a72c7198b7e180c
parent53aa444419c83c029c5502db0a3b01971d46d793
exp_aggr.adb (Build_Record_Aggr_Code): Perform a conversion of the target to the type of the aggregate in the case...

2008-08-04  Gary Dismukes  <dismukes@adacore.com>

* exp_aggr.adb (Build_Record_Aggr_Code): Perform a conversion of the
target to the type of the aggregate in the case where the target object
is class-wide.

* exp_ch5.adb (Expand_Simple_Function_Return): When the function's
result type is class-wide and inherently limited, and the expression
has a specific type, create a return object of the specific type, for
more efficient handling of returns of build-in-place aggregates (avoids
conversions of the class-wide return object to the specific type on
component assignments).

* sem_ch6.adb (Check_Return_Subtype_Indication): Suppress the error
about a type mismatch for a class-wide function with a return object
having a specific type when the object declaration doesn't come from
source. Such an object can result from the expansion of a simple return.

From-SVN: r138603
gcc/ada/exp_aggr.adb
gcc/ada/exp_ch5.adb
gcc/ada/sem_ch6.adb