diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-07-08 10:17:14 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-07-08 10:17:14 +0200 |
commit | 5884c232046e65f6b617ee69f34b4c90a31b68eb (patch) | |
tree | 262cecab20751245724b41e9418de2b1e18d13b3 /gcc/ada/exp_ch6.adb | |
parent | 2cbac6c692b9a68e9fedaa193ae756eea8ac23c5 (diff) | |
download | gcc-5884c232046e65f6b617ee69f34b4c90a31b68eb.zip gcc-5884c232046e65f6b617ee69f34b4c90a31b68eb.tar.gz gcc-5884c232046e65f6b617ee69f34b4c90a31b68eb.tar.bz2 |
[multiple changes]
2013-07-08 Robert Dewar <dewar@adacore.com>
* rtsfind.adb: Minor comment fix.
2013-07-08 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch4.adb (Check_Ghost_Subprogram_Call): Do not check the placement
of a Ghost function call when the enclosing context is being
preanalyzed.
2013-07-08 Ed Schonberg <schonberg@adacore.com>
* exp_ch6.adb (Expand_Inlined_Call, Process_Formals): If the
expression in a return statement is a numeric literal, qualify
it with the return type for proper resolution.
From-SVN: r200772
Diffstat (limited to 'gcc/ada/exp_ch6.adb')
-rw-r--r-- | gcc/ada/exp_ch6.adb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index d944ac9..d48544f 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -4680,7 +4680,8 @@ package body Exp_Ch6 is function Process_Formals (N : Node_Id) return Traverse_Result; -- Replace occurrence of a formal with the corresponding actual, or the - -- thunk generated for it. + -- thunk generated for it. Replace a return statement with an assignment + -- to the target of the call, with appropriate conversions if needed. function Process_Sloc (Nod : Node_Id) return Traverse_Result; -- If the call being expanded is that of an internal subprogram, set the @@ -4808,9 +4809,14 @@ package body Exp_Ch6 is -- errors, e.g. when the expression is a numeric literal and -- the context is private. If the expression is an aggregate, -- use a qualified expression, because an aggregate is not a - -- legal argument of a conversion. + -- legal argument of a conversion. Ditto for numeric literals, + -- which must be resolved to a specific type. - if Nkind_In (Expression (N), N_Aggregate, N_Null) then + if Nkind_In (Expression (N), N_Aggregate, + N_Null, + N_Real_Literal, + N_Integer_Literal) + then Ret := Make_Qualified_Expression (Sloc (N), Subtype_Mark => New_Occurrence_Of (Ret_Type, Sloc (N)), |