* fix default parameter compare for widestring

git-svn-id: trunk@982 -
This commit is contained in:
peter 2005-08-30 06:23:31 +00:00
parent 62972054c4
commit 1b4c7b5a3e
3 changed files with 35 additions and 1 deletions

1
.gitattributes vendored
View File

@ -6187,6 +6187,7 @@ tests/webtbs/tw4247.pp svneol=native#text/plain
tests/webtbs/tw4253.pp svneol=native#text/plain
tests/webtbs/tw4260.pp svneol=native#text/plain
tests/webtbs/tw4277.pp svneol=native#text/plain
tests/webtbs/tw4294.pp svneol=native#text/plain
tests/webtbs/tw4308.pp svneol=native#text/plain
tests/webtbs/tw4336.pp svneol=native#text/plain
tests/webtbs/ub1873.pp svneol=native#text/plain

View File

@ -41,7 +41,7 @@ implementation
uses
globtype,cpuinfo,procinfo,
symconst;
symconst,widestr;
function is_funcret_sym(p:tsymentry):boolean;
@ -89,6 +89,12 @@ implementation
equal_constsym:=true;
end;
end;
constwstring :
begin
if (sym1.value.len=sym2.value.len) and
(comparewidestrings(sym1.value.valueptr,sym2.value.valueptr)=0) then
equal_constsym:=true;
end;
constreal :
equal_constsym:=(pbestreal(sym1.value.valueptr)^=pbestreal(sym2.value.valueptr)^);
constset :

27
tests/webtbs/tw4294.pp Executable file
View File

@ -0,0 +1,27 @@
{ Source provided for Free Pascal Bug Report 4294 }
{ Submitted by "Martin Schreiber" on 2005-08-19 }
{ e-mail: }
unit tw4294;
interface
{$ifdef fpc}{$mode objfpc}{$endif}
{$H+}
const
widestrconst = widestring('abc');
ansistrconst = 'abc';
procedure wtest(const par1: widestring = widestrconst);
procedure atest(const par1: string = ansistrconst);
implementation
procedure atest(const par1: string = ansistrconst); //ok
begin
end;
procedure wtest(const par1: widestring = widestrconst); //error
//procedure wtest(const par1: widestring); //ok
begin
end;
end.