Browse Source

* do not search for overloaded operators while parsing constant declarations,
since they require function calls and it's not possible to call functions
inside constant blocks (and because current_procinfo is not necessarily
valid when a constant block is parsed, this moreover crashes the compiler)

git-svn-id: trunk@22018 -

Jonas Maebe 13 years ago
parent
commit
c25d9d5e06
1 changed files with 5 additions and 1 deletions
  1. 5 1
      compiler/ncnv.pas

+ 5 - 1
compiler/ncnv.pas

@@ -2148,7 +2148,11 @@ implementation
 
         if convtype=tc_none then
           begin
-            cdoptions:=[cdo_check_operator,cdo_allow_variant,cdo_warn_incompatible_univ];
+            cdoptions:=[cdo_allow_variant,cdo_warn_incompatible_univ];
+            { overloaded operators require calls, which is not possible inside
+              a constant declaration }
+            if block_type<>bt_const then
+              include(cdoptions,cdo_check_operator);
             if nf_explicit in flags then
               include(cdoptions,cdo_explicit);
             if nf_internal in flags then