Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi/Header Generation    [ Add a report in this area ]  
Report #:  73546   Status: Open
Private parameterless constructor causes ambiguity in header file
Project:  C++Builder Build #:  12.0.3210.17555
Version:    12.1 Submitted By:   Moritz Beutel
Report Type:  Basic functionality failure Date Reported:  5/1/2009 5:18:29 AM
Severity:    Serious / Highly visible problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All versions Internal Tracking #:   269269
Resolution: Deferred to Next Rel (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
The following code
// -----
unit qc73546;

interface

type
  TFoo = class
  private
    constructor Create;
  end;

implementation

constructor TFoo.Create;
begin
end;

end.
// -----
results in an invalid header file:
// -----
class PASCALIMPLEMENTATION TFoo : public System::TObject
{

typedef System::TObject inherited;


private:

__fastcall TFoo(void);
public:

/* TObject.Create */ inline __fastcall TFoo(void) : System::TObject() { }

/* TObject.Destroy */ inline __fastcall virtual ~TFoo(void) { }


};
// -----
Steps to Reproduce:
- Compile the following code (dcc32 -JPHN qc73546.pas):
// -----
unit qc73546;

interface

type
  TFoo = class
  private
    constructor Create;
  end;

implementation

constructor TFoo.Create;
begin
end;

end.
// -----

- Run the resulting header file through BCC (bcc32 -c -P qc73546.hpp).

Exp.: compiles

Act.:
Error E2238 qc73546.hpp 31: Multiple declaration for '_fastcall TFoo::TFoo()'
Error E2344 qc73546.hpp 29: Earlier declaration of '_fastcall TFoo::TFoo()'
Workarounds
None
Attachment
qc73546.zip
Comments

None

Server Response from: ETNACODE01