소스 검색

* give better error message for #40821

florian 1 년 전
부모
커밋
13de117b8e
2개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 0
      compiler/msg/errore.msg
  2. 1 1
      compiler/pdecl.pas

+ 3 - 0
compiler/msg/errore.msg

@@ -1679,6 +1679,9 @@ parser_e_nostringaliasinsystem=03370_E_Using 'string' alias is not allowed in th
 parser_e_coperators_off=03371_E_C styled assignment operators are turned off
 % By default, c style assignment operators (+=, -=, *=, /=) are turn off. Either turn them on by the command line
 % parameter -Sc or in the source code by {\$COPERATORS ON}
+parser_e_cannot_evaluate_expression_at_compile_time=03372_E_Expression cannot be evaluted at compile time
+% Certain operations like the size of an object cannot be determined at compile time,
+% so it cannot be e.g. part of a constant expression.
 %
 % \end{description}
 %

+ 1 - 1
compiler/pdecl.pas

@@ -174,7 +174,7 @@ implementation
                  information about the final type yet, we need to use safe
                  values (mostly 0, except for (Bit)SizeOf()) }
                if not parse_generic then
-                 Message(parser_e_illegal_expression);
+                 Message(parser_e_cannot_evaluate_expression_at_compile_time);
                case tinlinenode(p).inlinenumber of
                  in_sizeof_x:
                    begin