mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 18:09:30 +02:00
compiler:
- allow pointermath for pchar, pwidechar, array[] of char and array[] of widechar without pointermath directive, - don't check tpointerdef().has_pointer_math if this is not a tpointerdef This fixes testsuite regression (tbs/tb0439.pp) git-svn-id: trunk@16679 -
This commit is contained in:
parent
7dd6cf07b4
commit
906ca89f4e
@ -1737,7 +1737,9 @@ implementation
|
||||
if nodetype=addn then
|
||||
begin
|
||||
if not(cs_extsyntax in current_settings.moduleswitches) or
|
||||
(not(is_pchar(ld)) and not(cs_pointermath in current_settings.localswitches) and not tpointerdef(ld).has_pointer_math) then
|
||||
(not (is_pchar(ld) or is_chararray(ld) or is_open_chararray(ld) or is_widechar(ld) or is_widechararray(ld) or is_open_widechararray(ld)) and
|
||||
not(cs_pointermath in current_settings.localswitches) and
|
||||
not((ld.typ=pointerdef) and tpointerdef(ld).has_pointer_math)) then
|
||||
CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
|
||||
if (rd.typ=pointerdef) and
|
||||
(tpointerdef(rd).pointeddef.size>1) then
|
||||
@ -1768,7 +1770,9 @@ implementation
|
||||
if (lt=niln) then
|
||||
CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),'NIL',rd.typename);
|
||||
if not(cs_extsyntax in current_settings.moduleswitches) or
|
||||
(not(is_pchar(ld)) and not(cs_pointermath in current_settings.localswitches) and not tpointerdef(ld).has_pointer_math) then
|
||||
(not (is_pchar(ld) or is_chararray(ld) or is_open_chararray(ld) or is_widechar(ld) or is_widechararray(ld) or is_open_widechararray(ld)) and
|
||||
not(cs_pointermath in current_settings.localswitches) and
|
||||
not((ld.typ=pointerdef) and tpointerdef(ld).has_pointer_math)) then
|
||||
CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
|
||||
if (ld.typ=pointerdef) then
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user