When the result type of a function requiring built-in-place return is only visible through a limited_with clause, the compiled needs to wait for the nonlimited view to be available in order to compute whether the built-in-place return is needed, and this comprises tagging the function with the Returns_By_Ref flag. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch6.adb (Build_In_Place_Formal): Also compute Returns_By_Ref for the function if the extra formals were not built initially.