Fails on ISO 7185 dispose
Original Reporter info from Mantis: samiam95124
-
Reporter name: Scott Franco
Original Reporter info from Mantis: samiam95124
- Reporter name: Scott Franco
Description:
Fails to allow ISO 7185 use of tagfield constants on dispose.
I have included the run from two other compilers to show the correct behavior, as well as the source (test.pas).
Steps to reproduce:
C:\projects\PASCAL\pascal-p5>fpc -Miso test.pas
Free Pascal Compiler version 3.2.0 [2020/06/04] for i386
Copyright (c) 1993-2020 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling test.pas
test.pas(10,14) Fatal: Syntax error, ")" expected but "," found
Fatal: Compilation aborted
Error: C:\FPC\3.2.0\bin\i386-Win32\ppc386.exe returned an error exitcode
C:\projects\PASCAL\pascal-p5>type test.pas
program test;
type r = record case b: boolean of false: (i: integer); true: (c: char) end;
var rp: ^r;
begin
new(rp, true);
dispose(rp, true)
end.
C:\projects\PASCAL\pascal-p5>gpc --classic-pascal-level-0 test.pas
test.pas: In main program:
test.pas:10: warning: tag fields ignored in `Dispose'
C:\projects\PASCAL\pascal-p5>p5 test
Compiling and running test
P5 Pascal compiler vs. 1.4.x
Pascal-P5 complies with the requirements of level 0 of ISO/IEC 7185.
1 -32 program test;
2 -32
3 -32 type r = record case b: boolean of false: (i: integer); true: (c: char) end;
4 -32
5 -32 var rp: ^r;
6 -32
7 -32 begin
8 3
9 3 new(rp, true);
10 10 dispose(rp, true)
11 15
12 15 end.
Errors in program: 0
P5 Pascal interpreter vs. 1.4.x
Assembling/loading program
Running program
program complete
C:\projects\PASCAL\pascal-p5>
Additional information:
Please note current ISO 7185 acceptance test is at:
https://sourceforge.net/p/pascalp5/code/ci/master/tree/standard_tests/iso7185pat.pas
Thanks.
Mantis conversion info:
- Mantis ID: 37320
- OS: Windows
- OS Build: 10
- Version: 3.2.0
- Fixed in version: 3.3.1