Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
Compiler
Delphi
Anonymous Methods
BASM
Code Generation/Optimization
Error Recovery
Errors - Warnings
Exceptions
Execution
Finalization
Generics
Header Generation
Interaction with UI
Interfaces
Language
Linker
Make Logic
Memory Manager
OBJ Generation
OBJ Support
Other Compiler
Packages
RTTI
String Resources
TD Debug Info
Thread Local Storage
Version resilience
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/Compiler/Delphi/Header Generation
[ Add a report in this area ]
Report #:
92477
Status:
Closed
DCC doesn't emit underlying enum types
Project:
C++Builder
Build #:
15.0
Version:
15.1
Submitted By:
Luis Branca
Report Type:
Minor failure / Design problem
Date Reported:
3/22/2011 10:57:04 AM
Severity:
Commonly encountered problem
Last Updated:
3/20/2012 2:24:39 AM
Platform:
All platforms
Internal Tracking #:
282349
Resolution:
Fixed
(Resolution Comments)
Resolved in Build:
:
16.0.4201.40972
Duplicate of:
None
Voting and Rating
Overall Rating:
(1 Total Rating)
5.00 out of 5
Total Votes:
20
Description
Forward declaration for enums generated by the delphi compiler is not currently possible because it's underlying type is missing. This could have been implemented since D2009, because of it's partial support for C++0x (which brought that feature into the C++ realm).
Currently it's still not possible to forward declare some enums from the VCL like TFieldType, TFieldKind, TLocateOption because auto generated hpp's do not propagate their underlying type as in:
enum TFieldType : BYTE { ftUnknown, (...), ftSingle };
enum TFieldKind : BYTE { fkData, fkCalculated, fkLookup, fkInternalCalc, fkAggregate };
enum TLocateOption : BYTE { loCaseInsensitive, loPartialKey };
This really would open the way to have extremely clean and lean headers (and way faster compilations).
More information in
https://forums.embarcadero.com/thread.jspa?messageID=324731#324731
Steps to Reproduce:
To bypass inclusion of Db.hpp on a header, try to use
namespace Db { // #include <DB.hpp>
enum TLocateOption : BYTE;
} using Db::TLocateOption;
it won't compile (type mismatch?).
There is no way on the C++ specs to forward declare an enum it we do not specify it's underlying type.
Workarounds
Manually edit and patch all auto generated enums from VCL's .hpp files that we intend to use on forward declarations, adding the missing underlying type (as exemplified above).
Attachment
None
Comments
None
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us