mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-24 01:29:44 +02:00
parent
ce9b080854
commit
801837f60d
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
|
||||
|
@ -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
15
tests/webtbs/tw10681.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user