View Issue Details

IDProjectCategoryView StatusLast Update
0032049FPCFCLpublic2017-07-09 10:05
ReporterMaciej IzakAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.1.1Product Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0032049: fcl-passrc fails for "operator" field (declaration and usage)
Descriptionfcl-passrc fails for "operator" field (declaration and usage), for example:

{$MODE DELPHI}

type
  TMyRec = record
    operator: Int64;
  end;

implementation

var
  r: TMyRec;
begin
  r.operator := 10;
end.
TagsNo tags attached.
Fixed in Revision36702
FPCOldBugId0
FPCTarget
Attached Files

Activities

Michael Van Canneyt

2017-06-21 15:00

administrator   ~0101242

home:~> fpc -S2 tr.pp
tr.pp(3,5) Fatal: Syntax error, "identifier" expected but "OPERATOR" found
Fatal: Compilation aborted
Error: /usr/local/bin/ppcx64 returned an error exitcode

Maciej Izak

2017-06-21 15:16

reporter   ~0101246

It works only in Delphi mode.

Michael Van Canneyt

2017-06-21 15:40

administrator   ~0101249

Not
{$modeswitch advancedrecords}

(it is different) ?

Maciej Izak

2017-06-21 15:50

reporter   ~0101250

Last edited: 2017-06-21 15:51

View 2 revisions

Only Delphi mode. Objfpc is more restrictive (even with advancedrecords).

Thaddy de Koning

2017-06-21 19:27

reporter   ~0101253

Last edited: 2017-06-21 19:42

View 6 revisions

I have a vague recollection that you can escape this kind of "operator" with an ampersand. That would also work in Delphi.
I know that Delphi allows "operator" as a function or variable because unlike FPC it is not a keyword, but it also allows to escape it with &. That would solve it? It ain't no operator....but a field.
In the context of the passrc. If the compiler allows it, yes, then it is an issue. Did you test?

Maciej Izak

2017-06-21 20:10

reporter   ~0101257

operator as field name works for both: for FPC compiler ({$MODE DELPHI}) and for Delphi. IMO it should also works in fcl-passrc.

Thaddy de Koning

2017-06-21 22:42

reporter   ~0101258

That's what I wondered. So, yes.

Michael Van Canneyt

2017-07-09 09:43

administrator   ~0101626

Fixed, thanks for reporting.

Issue History

Date Modified Username Field Change
2017-06-21 14:40 Maciej Izak New Issue
2017-06-21 15:00 Michael Van Canneyt Assigned To => Michael Van Canneyt
2017-06-21 15:00 Michael Van Canneyt Status new => assigned
2017-06-21 15:00 Michael Van Canneyt Note Added: 0101242
2017-06-21 15:15 Maciej Izak Description Updated View Revisions
2017-06-21 15:16 Maciej Izak Note Added: 0101246
2017-06-21 15:40 Michael Van Canneyt Note Added: 0101249
2017-06-21 15:50 Maciej Izak Note Added: 0101250
2017-06-21 15:51 Maciej Izak Note Edited: 0101250 View Revisions
2017-06-21 19:27 Thaddy de Koning Note Added: 0101253
2017-06-21 19:29 Thaddy de Koning Note Edited: 0101253 View Revisions
2017-06-21 19:30 Thaddy de Koning Note Edited: 0101253 View Revisions
2017-06-21 19:30 Thaddy de Koning Note Edited: 0101253 View Revisions
2017-06-21 19:39 Thaddy de Koning Note Edited: 0101253 View Revisions
2017-06-21 19:42 Thaddy de Koning Note Edited: 0101253 View Revisions
2017-06-21 20:10 Maciej Izak Note Added: 0101257
2017-06-21 22:42 Thaddy de Koning Note Added: 0101258
2017-07-09 09:43 Michael Van Canneyt Fixed in Revision => 36700
2017-07-09 09:43 Michael Van Canneyt Note Added: 0101626
2017-07-09 09:43 Michael Van Canneyt Status assigned => resolved
2017-07-09 09:43 Michael Van Canneyt Fixed in Version => 3.1.1
2017-07-09 09:43 Michael Van Canneyt Resolution open => fixed
2017-07-09 09:43 Michael Van Canneyt Target Version => 3.2.0
2017-07-09 10:05 Michael Van Canneyt Fixed in Revision 36700 => 36702