View Issue Details

IDProjectCategoryView StatusLast Update
0029745FPCCompilerpublic2016-03-17 10:44
ReporterBart Broersma Assigned ToSven Barth  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformi386OSWindows 
Product Version3.0.0 
Fixed in Version3.1.1 
Summary0029745: Codepage + {$H+} + ClassHelper + Initialized string variable gives: Error: identifier idents no member ...
DescriptionReported by Silvio Cl├ęcio in fpc-pascal mailinglist
(http://lists.freepascal.org/pipermail/fpc-pascal/2016-February/046998.html)

If your program has a {$codepage xxx} and you have a classhelper and use {$H+} and you have an initiaize string variable (local or global) compiling will fail with: Error: identifier idents no member ...
Steps To Reproduce{$apptype console}
{$ifdef fpc}
{$mode objfpc}
{$h+}
{$codepage utf8}
{$endif}

uses Classes;

type
  TFoo = class helper for TStream
  public
    procedure Bar;
  end;

  procedure TFoo.Bar;
  begin
  end;

var
  s: string = '';
  m: TStream;
begin
  m := TMemoryStream.Create;
  try
    m.Bar;
  finally
    m.Free;
  end;
  writeln(defaultsystemcodepage);
end.

C:\Users\Bart\LazarusProjecten\ConsoleProjecten>fpc test.pas
Free Pascal Compiler version 3.0.0 [2015/11/16] for i386
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling test.pas
test.pas(26,7) Error: identifier idents no member "Bar"
test.pas(32) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: C:\devel\fpc\3.0.0\bin\i386-Win32\ppc386.exe returned an error exitcode
Additional InformationThis issue goes away if you do any of these things:
- remove {$H+}
- remove {$codepage xxx} (the issue does not depend on what codepage is specified)
- remove the initialization of variable "s"

Note: the issue also happens when "s" is a local varaiable in a procedure.
TagsNo tags attached.
Fixed in Revision33214
FPCOldBugId
FPCTarget
Attached Files

Activities

Sven Barth

2016-03-10 20:44

manager   ~0090869

Please test and close if okay.

Regards,
Sven

Bart Broersma

2016-03-17 10:44

reporter   ~0091149

According to the original reporter on ML (Silvio) this is fixed.

Issue History

Date Modified Username Field Change
2016-02-27 14:15 Bart Broersma New Issue
2016-03-10 00:00 Sven Barth Assigned To => Sven Barth
2016-03-10 00:00 Sven Barth Status new => assigned
2016-03-10 20:44 Sven Barth Fixed in Revision => 33214
2016-03-10 20:44 Sven Barth Note Added: 0090869
2016-03-10 20:44 Sven Barth Status assigned => resolved
2016-03-10 20:44 Sven Barth Fixed in Version => 3.1.1
2016-03-10 20:44 Sven Barth Resolution open => fixed
2016-03-17 10:44 Bart Broersma Note Added: 0091149
2016-03-17 10:44 Bart Broersma Status resolved => closed