From 9dbd69c30727acf77b289ae0c1271a23ac7772ec Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sat, 18 Mar 2006 22:02:37 +0000 Subject: [PATCH] * don't give range check hints/warnings for conversions of realconstnodes to types with less precision than the default (bug 4898) git-svn-id: trunk@2957 - --- .gitattributes | 1 + compiler/htypechk.pas | 3 ++- tests/webtbs/tw4898.pp | 12 ++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 tests/webtbs/tw4898.pp diff --git a/.gitattributes b/.gitattributes index abc922146f..00b24a9142 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6752,6 +6752,7 @@ tests/webtbs/tw4768.pp -text tests/webtbs/tw4778.pp svneol=native#text/plain tests/webtbs/tw4789.pp svneol=native#text/plain tests/webtbs/tw4809.pp svneol=native#text/plain +tests/webtbs/tw4898.pp -text tests/webtbs/ub1873.pp svneol=native#text/plain tests/webtbs/ub1883.pp svneol=native#text/plain tests/webtbs/uw0555.pp svneol=native#text/plain diff --git a/compiler/htypechk.pas b/compiler/htypechk.pas index b6484e7728..11ca58bce4 100644 --- a/compiler/htypechk.pas +++ b/compiler/htypechk.pas @@ -2228,7 +2228,8 @@ implementation not is_boolean(destdef) and assigned(source.resulttype.def) and (source.resulttype.def.deftype in [enumdef,orddef,floatdef]) and - not is_boolean(source.resulttype.def) then + not is_boolean(source.resulttype.def) and + not is_constrealnode(source) then begin if (destdef.size < source.resulttype.def.size) then begin diff --git a/tests/webtbs/tw4898.pp b/tests/webtbs/tw4898.pp new file mode 100644 index 0000000000..1f49110f89 --- /dev/null +++ b/tests/webtbs/tw4898.pp @@ -0,0 +1,12 @@ +{ %OPT=-Sewh -vwh} + +{ Source provided for Free Pascal Bug Report 4898 } +{ Submitted by "Naj Kejah" on 2006-03-13 } +{ e-mail: universario@hotmail.com } +program aFP211p; +var R : real; +begin + R:=0.0; + writeln(r); +end. +