* Fixed bug #10681.

+ Test.

git-svn-id: trunk@9879 -
This commit is contained in:
yury 2008-01-23 10:24:04 +00:00
parent ce9b080854
commit 801837f60d
3 changed files with 21 additions and 1 deletions

1
.gitattributes vendored
View File

@ -7981,6 +7981,7 @@ tests/webtbs/tw10623.pp svneol=native#text/plain
tests/webtbs/tw1066a.pp svneol=native#text/plain
tests/webtbs/tw1066b.pp svneol=native#text/plain
tests/webtbs/tw1068.pp svneol=native#text/plain
tests/webtbs/tw10681.pp svneol=native#text/plain
tests/webtbs/tw1071.pp svneol=native#text/plain
tests/webtbs/tw1073.pp svneol=native#text/plain
tests/webtbs/tw1081.pp svneol=native#text/plain

View File

@ -531,8 +531,12 @@ implementation
eq:=te_equal
else
begin
{ Delphi does not allow explicit type conversions for float types like:
single_var:=single(double_var);
But if such conversion is inserted by compiler (internal) for some purpose,
it should be allowed even in Delphi mode. }
if (fromtreetype=realconstn) or
not((cdo_explicit in cdoptions) and
not((cdoptions*[cdo_explicit,cdo_internal]=[cdo_explicit]) and
(m_delphi in current_settings.modeswitches)) then
begin
doconv:=tc_real_2_real;

15
tests/webtbs/tw10681.pp Normal file
View File

@ -0,0 +1,15 @@
{%norun}
{$IFDEF FPC}
{$MODE Delphi}
{$ENDIF}
var
AStr : string;
AComp : Comp;
AInt : Integer;
begin
AStr := '1.2345';
Val(AStr, AComp, AInt);
end.