mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-03 05:58:24 +02:00
* fix default parameter compare for widestring
git-svn-id: trunk@982 -
This commit is contained in:
parent
62972054c4
commit
1b4c7b5a3e
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
|
||||
|
@ -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
27
tests/webtbs/tw4294.pp
Executable 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.
|
Loading…
Reference in New Issue
Block a user