Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi/Header Generation    [ Add a report in this area ]  
Report #:  69296   Status: Open
untyped const declaration inside classes loose their value in header and getting members
Project:  C++Builder Build #:  11.0.2902.10471
Version:    11.2 Submitted By:   Thomas Koos
Report Type:  Basic functionality failure Date Reported:  11/25/2008 6:28:25 AM
Severity:    Commonly encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All versions Internal Tracking #:   267989
Resolution: None (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
When defining untyped constant in a delphi class with a value, the value gets lost on transfer to the HPP. The HPP contains a member declaration instead of an const delcaration and the const value is lost.

The delphi compiler has no memory for the constant, so the member is never initialized (just to zero, as for all members).

Basicly, the real constant gets an member of the class and the ordinal constant value gets lost.

It is even unclear why the type changes for the constants from shortint to word by a change of the constant value from 99 to 999.
Steps to Reproduce:
1. Create a pascal class and define untyped constants with a defined value inside of the class
2. Create a c++ project using the class
3. look at the constants
Workarounds
None
Attachment
QC69296.zip
Comments

None

Server Response from: ETNACODE01