* don't allow logical operators on char, resolves #8780

git-svn-id: trunk@7181 -
This commit is contained in:
florian 2007-04-28 18:43:58 +00:00
parent 2eb40fc025
commit 01de46a0f4
5 changed files with 25 additions and 1 deletions

3
.gitattributes vendored
View File

@ -7279,6 +7279,9 @@ tests/webtbf/tw8451.pp svneol=native#text/plain
tests/webtbf/tw8528.pp svneol=native#text/plain
tests/webtbf/tw8583.pp svneol=native#text/plain
tests/webtbf/tw8588.pp svneol=native#text/plain
tests/webtbf/tw8780a.pp svneol=native#text/plain
tests/webtbf/tw8780b.pp svneol=native#text/plain
tests/webtbf/tw8780c.pp svneol=native#text/plain
tests/webtbf/tw8781.pp svneol=native#text/plain
tests/webtbf/uw0744.pp svneol=native#text/plain
tests/webtbf/uw0840a.pp svneol=native#text/plain

View File

@ -963,7 +963,13 @@ implementation
result := hp;
exit;
{$endif addstringopt}
end;
end
end
else if not(nodetype in [ltn,lten,gtn,gten,unequaln,equaln]) then
begin
CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
result:=cnothingnode.create;
exit;
end;
end
{ There is a widechar? }

5
tests/webtbf/tw8780a.pp Normal file
View File

@ -0,0 +1,5 @@
{ %fail }
var c,c1,c2 : char;
begin
c:=c1 or c2; // no error
end.

5
tests/webtbf/tw8780b.pp Normal file
View File

@ -0,0 +1,5 @@
{ %fail }
var c,c1,c2 : char;
begin
c:='a' or 'b'; // Error: Operation "or" not supported for types "Char" and "Char"
end.

5
tests/webtbf/tw8780c.pp Normal file
View File

@ -0,0 +1,5 @@
{ %fail }
var c,c1,c2 : char;
begin
c:=#1 or #2; // Error: Operation "or" not supported for types "Char" and "Char"
end.