* allow pred/succ on non continous enumerations in delphi mode

git-svn-id: trunk@1878 -
This commit is contained in:
florian 2005-12-04 18:35:19 +00:00
parent 3a81473a05
commit 46ecdc8f94
3 changed files with 15 additions and 1 deletions

1
.gitattributes vendored
View File

@ -6389,6 +6389,7 @@ tests/webtbs/tw4520.pp -text svneol=unset#text/plain
tests/webtbs/tw4529.pp -text svneol=unset#text/plain
tests/webtbs/tw4537.pp svneol=native#text/plain
tests/webtbs/tw4540.pp -text svneol=unset#text/plain
tests/webtbs/tw4557.pp svneol=native#text/plain
tests/webtbs/tw4566.pp -text svneol=unset#text/plain
tests/webtbs/ub1873.pp svneol=native#text/plain
tests/webtbs/ub1883.pp svneol=native#text/plain

View File

@ -1613,7 +1613,8 @@ implementation
else
begin
if (resulttype.def.deftype=enumdef) and
(tenumdef(resulttype.def).has_jumps) then
(tenumdef(resulttype.def).has_jumps) and
not(m_delphi in aktmodeswitches) then
CGMessage(type_e_succ_and_pred_enums_with_assign_not_possible);
end;

12
tests/webtbs/tw4557.pp Normal file
View File

@ -0,0 +1,12 @@
{ Source provided for Free Pascal Bug Report 4557 }
{ Submitted by "Marek Mauder" on 2005-11-29 }
{ e-mail: pentar@seznam.cz }
program FPCBugs;
{$IFDEF FPC}{$MODE DELPHI}{$ENDIF}
type
TEnum = (Item1 = 5, Item2 = 10, Item3 = 20);
var
Enum: TEnum = Item1;
begin
Enum := Succ(Enum);
end.