View Issue Details

IDProjectCategoryView StatusLast Update
0035348FPCCompilerpublic2019-04-14 22:49
ReporterThaddy de KoningAssigned ToSven Barth 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformallOSallOS Versionall
Product Version3.3.1Product Build41848 
Target VersionFixed in Version3.3.1 
Summary0035348: operators inc/dec crashes the compiler when a default value is given for the amount.
DescriptionThe operators inc/dec generate a compiler crash when the amount parameter has a default value.
Steps To Reproduce// example taken from engkin's entry on the forum
{$mode objfpc}{$H+}
 
Type
  TAZ=String;
 
operator inc(az: TAZ; i: integer=1) raz:TAZ; // inline;
begin
end;
 
begin
end.
Additional InformationSame example also crashes with dec.
It does not crash when no default value is given.
It maybe simply that the default value should not be allowed, but the compiler should not crash.

I wonder if these operators should not be dropped: the procedure overloads are fine.
TagsNo tags attached.
Fixed in Revision41869
FPCOldBugId
FPCTarget
Attached Files

Activities

Thaddy de Koning

2019-04-09 10:12

reporter   ~0115338

See forum here https://forum.lazarus.freepascal.org/index.php/topic,44982.msg316824.html#msg316824

Sven Barth

2019-04-14 22:49

manager   ~0115507

This now fails correctly no matter if there is a default value or not as Inc/Dec are unary operators.

Issue History

Date Modified Username Field Change
2019-04-09 10:07 Thaddy de Koning New Issue
2019-04-09 10:12 Thaddy de Koning Note Added: 0115338
2019-04-14 22:49 Sven Barth Fixed in Revision => 41869
2019-04-14 22:49 Sven Barth Note Added: 0115507
2019-04-14 22:49 Sven Barth Status new => resolved
2019-04-14 22:49 Sven Barth Fixed in Version => 3.3.1
2019-04-14 22:49 Sven Barth Resolution open => fixed
2019-04-14 22:49 Sven Barth Assigned To => Sven Barth