* allow default parameters for constref (mantis #29992)

git-svn-id: trunk@33480 -
This commit is contained in:
Jonas Maebe 2016-04-10 21:27:29 +00:00
parent 953c47dd97
commit 08d63e3408
3 changed files with 13 additions and 1 deletions

1
.gitattributes vendored
View File

@ -15004,6 +15004,7 @@ tests/webtbs/tw29930.pp svneol=native#text/plain
tests/webtbs/tw29958.pp svneol=native#text/pascal
tests/webtbs/tw2998.pp svneol=native#text/plain
tests/webtbs/tw2999.pp svneol=native#text/plain
tests/webtbs/tw29992.pp svneol=native#text/plain
tests/webtbs/tw3004.pp svneol=native#text/plain
tests/webtbs/tw3005.pp svneol=native#text/plain
tests/webtbs/tw3010.pp svneol=native#text/plain

View File

@ -261,7 +261,7 @@ implementation
vs:=tparavarsym(sc[0]);
if sc.count>1 then
Message(parser_e_default_value_only_one_para);
if not(vs.varspez in [vs_value,vs_const]) then
if not(vs.varspez in [vs_value,vs_const,vs_constref]) then
Message(parser_e_default_value_val_const);
bt:=block_type;
block_type:=bt_const;

11
tests/webtbs/tw29992.pp Normal file
View File

@ -0,0 +1,11 @@
{ %norun }
{$mode objfpc}
procedure Test(constref AParam: String = 'def_param');
begin
writeln(AParam);
end;
begin
end.