From 5f4b89903ca8ac8ffa78e372b33c66208c6aad39 Mon Sep 17 00:00:00 2001
From: peter <peter@freepascal.org>
Date: Mon, 10 Sep 2007 16:40:40 +0000
Subject: [PATCH]   * use callnodeflag to check if the result of a function is
 used

git-svn-id: trunk@8425 -
---
 compiler/nbas.pas | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/compiler/nbas.pas b/compiler/nbas.pas
index d72b21a34b..1a66ab8e2b 100644
--- a/compiler/nbas.pas
+++ b/compiler/nbas.pas
@@ -378,9 +378,8 @@ implementation
          if (not (cs_extsyntax in current_settings.moduleswitches)) and
             assigned(left.resultdef) and
             not((left.nodetype=calln) and
-                { don't complain when funcretrefnode is set, because then the
-                  value is already used. And also not for constructors }
-                (assigned(tcallnode(left).funcretnode) or
+                { don't complain when the value is used. And also not for constructors }
+                ((cnf_return_value_used in tcallnode(left).callnodeflags) or
                  (tcallnode(left).procdefinition.proctypeoption=potype_constructor))) and
             not(is_void(left.resultdef)) then
            CGMessage(parser_e_illegal_expression);