mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-15 14:19:28 +02:00
* don't allow logical operators on char, resolves #8780
git-svn-id: trunk@7181 -
This commit is contained in:
parent
2eb40fc025
commit
01de46a0f4
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -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
|
||||
|
@ -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
5
tests/webtbf/tw8780a.pp
Normal 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
5
tests/webtbf/tw8780b.pp
Normal 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
5
tests/webtbf/tw8780c.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user