aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/gcc-interface/utils2.c')
-rw-r--r--gcc/ada/gcc-interface/utils2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c
index 3322341..332d730 100644
--- a/gcc/ada/gcc-interface/utils2.c
+++ b/gcc/ada/gcc-interface/utils2.c
@@ -1554,8 +1554,9 @@ build_cond_expr (tree result_type, tree condition_operand,
/* If the result type is unconstrained, take the address of the operands and
then dereference the result. Likewise if the result type is passed by
- reference, but this is natively handled in the gimplifier. */
+ reference, because creating a temporary of this type is not allowed. */
if (TREE_CODE (result_type) == UNCONSTRAINED_ARRAY_TYPE
+ || TYPE_IS_BY_REFERENCE_P (result_type)
|| CONTAINS_PLACEHOLDER_P (TYPE_SIZE (result_type)))
{
result_type = build_pointer_type (result_type);