aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index bd027eb..8a435a6 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1328,6 +1328,9 @@ expand_call_inline (tree *tp, int *walk_subtrees, void *data)
expr = build1 (STMT_EXPR, TREE_TYPE (TREE_TYPE (fn)), make_node (COMPOUND_STMT));
/* There is no scope associated with the statement-expression. */
STMT_EXPR_NO_SCOPE (expr) = 1;
+ if (lookup_attribute ("warn_unused_result",
+ TYPE_ATTRIBUTES (TREE_TYPE (fn))))
+ STMT_EXPR_WARN_UNUSED_RESULT (expr) = 1;
stmt = STMT_EXPR_STMT (expr);
#else /* INLINER_FOR_JAVA */
/* Build a block containing code to initialize the arguments, the