mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 17:09:09 +02:00
* string constants passed to array of const should be passed as ansistrings
git-svn-id: trunk@2523 -
This commit is contained in:
parent
0a2d1df0b6
commit
bbd3e2e391
@ -927,43 +927,46 @@ implementation
|
|||||||
{ Insert typeconvs for array of const }
|
{ Insert typeconvs for array of const }
|
||||||
if dovariant then
|
if dovariant then
|
||||||
begin
|
begin
|
||||||
case hp.left.resulttype.def.deftype of
|
if hp.left.nodetype=stringconstn then
|
||||||
enumdef :
|
hp.left:=ctypeconvnode.create_internal(hp.left,cansistringtype)
|
||||||
hp.left:=ctypeconvnode.create_internal(hp.left,s32inttype);
|
else
|
||||||
arraydef :
|
case hp.left.resulttype.def.deftype of
|
||||||
begin
|
enumdef :
|
||||||
if is_chararray(hp.left.resulttype.def) then
|
hp.left:=ctypeconvnode.create_internal(hp.left,s32inttype);
|
||||||
hp.left:=ctypeconvnode.create_internal(hp.left,charpointertype)
|
arraydef :
|
||||||
else
|
begin
|
||||||
if is_widechararray(hp.left.resulttype.def) then
|
if is_chararray(hp.left.resulttype.def) then
|
||||||
hp.left:=ctypeconvnode.create_internal(hp.left,widecharpointertype)
|
hp.left:=ctypeconvnode.create_internal(hp.left,charpointertype)
|
||||||
else
|
else
|
||||||
|
if is_widechararray(hp.left.resulttype.def) then
|
||||||
|
hp.left:=ctypeconvnode.create_internal(hp.left,widecharpointertype)
|
||||||
|
else
|
||||||
|
CGMessagePos1(hp.left.fileinfo,type_e_wrong_type_in_array_constructor,hp.left.resulttype.def.typename);
|
||||||
|
end;
|
||||||
|
orddef :
|
||||||
|
begin
|
||||||
|
if is_integer(hp.left.resulttype.def) and
|
||||||
|
not(is_64bitint(hp.left.resulttype.def)) then
|
||||||
|
hp.left:=ctypeconvnode.create(hp.left,s32inttype)
|
||||||
|
else if is_void(hp.left.resulttype.def) then
|
||||||
|
CGMessagePos1(hp.left.fileinfo,type_e_wrong_type_in_array_constructor,hp.left.resulttype.def.typename);
|
||||||
|
end;
|
||||||
|
floatdef :
|
||||||
|
if not(is_currency(hp.left.resulttype.def)) then
|
||||||
|
hp.left:=ctypeconvnode.create(hp.left,pbestrealtype^);
|
||||||
|
procvardef :
|
||||||
|
hp.left:=ctypeconvnode.create(hp.left,voidpointertype);
|
||||||
|
stringdef,
|
||||||
|
variantdef,
|
||||||
|
pointerdef,
|
||||||
|
classrefdef:
|
||||||
|
;
|
||||||
|
objectdef :
|
||||||
|
if is_object(hp.left.resulttype.def) then
|
||||||
CGMessagePos1(hp.left.fileinfo,type_e_wrong_type_in_array_constructor,hp.left.resulttype.def.typename);
|
CGMessagePos1(hp.left.fileinfo,type_e_wrong_type_in_array_constructor,hp.left.resulttype.def.typename);
|
||||||
end;
|
else
|
||||||
orddef :
|
|
||||||
begin
|
|
||||||
if is_integer(hp.left.resulttype.def) and
|
|
||||||
not(is_64bitint(hp.left.resulttype.def)) then
|
|
||||||
hp.left:=ctypeconvnode.create(hp.left,s32inttype)
|
|
||||||
else if is_void(hp.left.resulttype.def) then
|
|
||||||
CGMessagePos1(hp.left.fileinfo,type_e_wrong_type_in_array_constructor,hp.left.resulttype.def.typename);
|
|
||||||
end;
|
|
||||||
floatdef :
|
|
||||||
if not(is_currency(hp.left.resulttype.def)) then
|
|
||||||
hp.left:=ctypeconvnode.create(hp.left,pbestrealtype^);
|
|
||||||
procvardef :
|
|
||||||
hp.left:=ctypeconvnode.create(hp.left,voidpointertype);
|
|
||||||
stringdef,
|
|
||||||
variantdef,
|
|
||||||
pointerdef,
|
|
||||||
classrefdef:
|
|
||||||
;
|
|
||||||
objectdef :
|
|
||||||
if is_object(hp.left.resulttype.def) then
|
|
||||||
CGMessagePos1(hp.left.fileinfo,type_e_wrong_type_in_array_constructor,hp.left.resulttype.def.typename);
|
CGMessagePos1(hp.left.fileinfo,type_e_wrong_type_in_array_constructor,hp.left.resulttype.def.typename);
|
||||||
else
|
end;
|
||||||
CGMessagePos1(hp.left.fileinfo,type_e_wrong_type_in_array_constructor,hp.left.resulttype.def.typename);
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
resulttypepass(hp.left);
|
resulttypepass(hp.left);
|
||||||
hp:=tarrayconstructornode(hp.right);
|
hp:=tarrayconstructornode(hp.right);
|
||||||
|
Loading…
Reference in New Issue
Block a user