浏览代码

* use callnodeflag to check if the result of a function is used

git-svn-id: trunk@8425 -
peter 18 年之前
父节点
当前提交
5f4b89903c
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      compiler/nbas.pas

+ 2 - 3
compiler/nbas.pas

@@ -378,9 +378,8 @@ implementation
          if (not (cs_extsyntax in current_settings.moduleswitches)) and
          if (not (cs_extsyntax in current_settings.moduleswitches)) and
             assigned(left.resultdef) and
             assigned(left.resultdef) and
             not((left.nodetype=calln) 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
                  (tcallnode(left).procdefinition.proctypeoption=potype_constructor))) and
             not(is_void(left.resultdef)) then
             not(is_void(left.resultdef)) then
            CGMessage(parser_e_illegal_expression);
            CGMessage(parser_e_illegal_expression);