aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/cvt.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r--gcc/cp/cvt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index bcd7c5a..29ceaeb 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -1031,6 +1031,9 @@ cp_get_callee_fndecl_nofold (tree call)
static void
maybe_warn_nodiscard (tree expr, impl_conv_void implicit)
{
+ if (!warn_unused_result || c_inhibit_evaluation_warnings)
+ return;
+
tree call = expr;
if (TREE_CODE (expr) == TARGET_EXPR)
call = TARGET_EXPR_INITIAL (expr);