Browse Source

* do not search overloaded assignment/conversion operators for internal
type conversions (those should always re-interpret the raw bits),
except for variants (because those are sometimes generated internally)
-- done so that -gt code at the node tree level can insert explicit
typecasts to integer types without triggering overloaded explicit
typecast operators such as in tests/test/terecs14

git-svn-id: trunk@21381 -

Jonas Maebe 13 years ago
parent
commit
ffe68ca284
1 changed files with 6 additions and 1 deletions
  1. 6 1
      compiler/defcmp.pas

+ 6 - 1
compiler/defcmp.pas

@@ -1673,7 +1673,12 @@ implementation
            { and e.g. fromdef=stringdef and todef=variantdef, then }
            { the test will still succeed                           }
            ((cdo_allow_variant in cdoptions) or
-            ((def_from.typ<>variantdef) and (def_to.typ<>variantdef))
+            ((def_from.typ<>variantdef) and
+             (def_to.typ<>variantdef) and
+             { internal typeconversions always have to be bitcasts (except for
+               variants) }
+             not(cdo_internal in cdoptions)
+            )
            ) and
            (
             { Check for variants? }