* fix precedence of IS operator, resolves #35909

git-svn-id: trunk@44266 -
This commit is contained in:
florian 2020-03-06 10:10:58 +00:00
parent fc49266749
commit bc3131688a
4 changed files with 16 additions and 3 deletions

1
.gitattributes vendored
View File

@ -16221,6 +16221,7 @@ tests/webtbf/tw35671.pp svneol=native#text/plain
tests/webtbf/tw35753.pp svneol=native#text/plain
tests/webtbf/tw3583.pp svneol=native#text/plain
tests/webtbf/tw35866.pp svneol=native#text/pascal
tests/webtbf/tw35909.pp svneol=native#text/pascal
tests/webtbf/tw35981.pp svneol=native#text/pascal
tests/webtbf/tw36114.pp svneol=native#text/pascal
tests/webtbf/tw36223.pp svneol=native#text/pascal

View File

@ -344,10 +344,10 @@ const
{ Warning these stay be ordered !! }
operator_levels:array[Toperator_precedence] of set of NOTOKEN..last_operator=
([_LT,_LTE,_GT,_GTE,_EQ,_NE,_OP_IN],
([_LT,_LTE,_GT,_GTE,_EQ,_NE,_OP_IN,_OP_IS],
[_PLUS,_MINUS,_OP_OR,_PIPE,_OP_XOR],
[_CARET,_SYMDIF,_STARSTAR,_STAR,_SLASH,
_OP_AS,_OP_IS,_OP_AND,_AMPERSAND,_OP_DIV,_OP_MOD,_OP_SHL,_OP_SHR],
_OP_AS,_OP_AND,_AMPERSAND,_OP_DIV,_OP_MOD,_OP_SHL,_OP_SHR],
[_STARSTAR] );
type

View File

@ -12283,7 +12283,7 @@ begin
if CurrentLoop.FGroupHeaderList.Count > 0 then
begin
{ when data band overflows use start with lowest gropup header }
if aBand is TFPReportCustomDataBand and
if (aBand is TFPReportCustomDataBand) and
not Assigned(TFPReportCustomDataBand(aband).MasterBand) then
lToMoveGrp := TFPReportCustomGroupHeaderBand(CurrentLoop.FGroupHeaderList[0])
{ when group header overflows use start with parent group header }

12
tests/webtbf/tw35909.pp Normal file
View File

@ -0,0 +1,12 @@
{ %fail% }
{$mode delphi}
program IS_Precedence;
uses
Classes;
var
O1, O2: TObject;
begin
O1 := TComponent.Create(nil);
O2 := TObject.Create;
Writeln(O1 is TComponent or O2 is TComponent); // <<< should not compile because OR has precedence before IS
end.