* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Subprogram_Type>: Do
not error out on a return type which has a size that overflows if the
return is done by invisible reference.
From-SVN: r223836
+2015-05-28 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Subprogram_Type>: Do
+ not error out on a return type which has a size that overflows if the
+ return is done by invisible reference.
+
2015-05-28 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils.c (gnat_pushdecl): Reunify the handling of array
/* If the return type has a size that overflows, we cannot have
a function that returns that type. This usage doesn't make
sense anyway, so give an error here. */
- if (TYPE_SIZE_UNIT (gnu_return_type)
+ if (!return_by_invisi_ref_p
+ && TYPE_SIZE_UNIT (gnu_return_type)
&& TREE_CODE (TYPE_SIZE_UNIT (gnu_return_type)) == INTEGER_CST
&& !valid_constant_size_p (TYPE_SIZE_UNIT (gnu_return_type)))
{