mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-07 18:50:25 +02:00
* moved warning about suspicious comp assignment to type check pass, catches also
assignments of constants git-svn-id: trunk@49242 -
This commit is contained in:
parent
02ec94c818
commit
29a5d3267c
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -12858,6 +12858,7 @@ tests/tbf/tb0270.pp svneol=native#text/pascal
|
||||
tests/tbf/tb0271.pp svneol=native#text/pascal
|
||||
tests/tbf/tb0272.pp svneol=native#text/plain
|
||||
tests/tbf/tb0273.pp svneol=native#text/pascal
|
||||
tests/tbf/tb0274.pp svneol=native#text/pascal
|
||||
tests/tbf/tb0588.pp svneol=native#text/pascal
|
||||
tests/tbf/ub0115.pp svneol=native#text/plain
|
||||
tests/tbf/ub0149.pp svneol=native#text/plain
|
||||
|
@ -1630,6 +1630,10 @@ implementation
|
||||
include(flags,nf_is_currency);
|
||||
typecheckpass(left);
|
||||
end;
|
||||
{ comp is handled by the fpu but not a floating type point }
|
||||
if is_fpucomp(resultdef) and not(is_fpucomp(left.resultdef)) and
|
||||
not (nf_explicit in flags) then
|
||||
Message(type_w_convert_real_2_comp);
|
||||
end
|
||||
else
|
||||
include(flags,nf_is_currency);
|
||||
|
@ -72,11 +72,6 @@ implementation
|
||||
function tx86typeconvnode.first_real_to_real : tnode;
|
||||
begin
|
||||
first_real_to_real:=nil;
|
||||
{ comp isn't a floating type }
|
||||
if (tfloatdef(resultdef).floattype=s64comp) and
|
||||
(tfloatdef(left.resultdef).floattype<>s64comp) and
|
||||
not (nf_explicit in flags) then
|
||||
CGMessage(type_w_convert_real_2_comp);
|
||||
if use_vectorfpu(resultdef) then
|
||||
expectloc:=LOC_MMREGISTER
|
||||
else
|
||||
|
8
tests/tbf/tb0274.pp
Normal file
8
tests/tbf/tb0274.pp
Normal file
@ -0,0 +1,8 @@
|
||||
{ %fail }
|
||||
{ %opt=-Sew }
|
||||
var
|
||||
c : comp;
|
||||
|
||||
begin
|
||||
c:=123.123;
|
||||
end.
|
Loading…
Reference in New Issue
Block a user