diff --git a/.gitattributes b/.gitattributes index efa9857b47..c2e35d34e6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6760,6 +6760,7 @@ tests/webtbs/tw4778.pp svneol=native#text/plain tests/webtbs/tw4789.pp svneol=native#text/plain tests/webtbs/tw4809.pp svneol=native#text/plain tests/webtbs/tw4826.pp svneol=native#text/plain +tests/webtbs/tw4881.pp svneol=native#text/plain tests/webtbs/tw4893a.pp svneol=native#text/plain tests/webtbs/tw4893b.pp svneol=native#text/plain tests/webtbs/tw4893c.pp svneol=native#text/plain diff --git a/compiler/pdecsub.pas b/compiler/pdecsub.pas index 4b4d36c56e..1da4134f34 100644 --- a/compiler/pdecsub.pas +++ b/compiler/pdecsub.pas @@ -518,26 +518,15 @@ implementation end else begin + if (m_mac in aktmodeswitches) then + try_to_consume(_UNIV); {currently does nothing} + single_type(tt,false); + { open string ? } if (varspez in [vs_out,vs_var]) and - ( - ( - ((token=_STRING) or (idtoken=_SHORTSTRING)) and - (cs_openstring in aktmoduleswitches) and - not(cs_ansistrings in aktlocalswitches) - ) or - (idtoken=_OPENSTRING)) then - begin - consume(token); - tt:=openshortstringtype; - end - else - begin - { everything else } - if (m_mac in aktmodeswitches) then - try_to_consume(_UNIV); {currently does nothing} - single_type(tt,false); - end; + (cs_openstring in aktmoduleswitches) and + is_shortstring(tt.def) then + tt:=openshortstringtype; if (target_info.system in [system_powerpc_morphos,system_m68k_amiga]) then begin diff --git a/compiler/psystem.pas b/compiler/psystem.pas index 5f88a9591f..cba138680e 100644 --- a/compiler/psystem.pas +++ b/compiler/psystem.pas @@ -240,6 +240,7 @@ implementation {$endif support_longstring} addtype('AnsiString',cansistringtype); addtype('WideString',cwidestringtype); + addtype('OpenString',openshortstringtype); addtype('Boolean',booltype); addtype('ByteBool',booltype); adddef('WordBool',torddef.create(bool16bit,0,1)); diff --git a/tests/webtbs/tw4881.pp b/tests/webtbs/tw4881.pp new file mode 100644 index 0000000000..b161e02c28 --- /dev/null +++ b/tests/webtbs/tw4881.pp @@ -0,0 +1,14 @@ +{ Source provided for Free Pascal Bug Report 4881 } +{ Submitted by "Jasper Neumann" on 2006-03-07 } +{ e-mail: _-jane-_@web.de } +type + openstring=integer; + +procedure test(var x:openstring); +begin end; + +var + x: openstring; +begin + test(x); +end.