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 #:
71288
Status:
Open
The compiler should explicitly qualify interfaces in type conversion operators
Project:
C++Builder
Build #:
3210
Version:
12.1
Submitted By:
Moritz Beutel
Report Type:
Basic functionality failure
Date Reported:
2/9/2009 3:01:59 AM
Severity:
Commonly encountered problem
Last Updated:
3/20/2012 2:24:39 AM
Platform:
All versions
Internal Tracking #:
268017
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
Currently, code like
// -----
uses
msxml;
type
TMyDispatch = class (TInterfacedObject, IDispatch)
...
end;
TMyXMLDocument2 = class (TInterfacedObject, IXMLDocument2)
...
end;
// -----
emits this to the header file:
// -----
class PASCALIMPLEMENTATION TMyDispatch : public System::TInterfacedObject
{
...
public:
#if defined(MANAGED_INTERFACE_OPERATORS)
...
#else
operator IDispatch*(void) { return (IDispatch*)&__IDispatch; }
#endif
};
class PASCALIMPLEMENTATION TMyXMLDocument2 : public System::TInterfacedObject
{
...
public:
#if defined(MANAGED_INTERFACE_OPERATORS)
...
#else
operator IXMLDocument2*(void) { return (IXMLDocument2*)&__IXMLDocument2; }
#endif
};
// -----
No namespace qualifier is added, regardless of whether the symbol is declared as $EXTERNALSYM (as IDispatch is) or not. This is prone to ambiguities.
I suggest that the compiler emits ::-prefixed names for $EXTERNALSYM'ed types and full namespace qualifiers otherwise:
// -----
operator ::IDispatch*(void) { return (::IDispatch*)&__IDispatch; }
#endif
...
operator Msxml::IXMLDocument2*(void) { return (Msxml::IXMLDocument2*)&__IXMLDocument2; }
// -----
Steps to Reproduce:
- Create a new .cpp file with this content (or download the attachment):
// -----
#include <vcl.h>
#include <ScrptMgr.hpp>
#include <tchar.h>
#pragma hdrstop
int _tmain (void)
{
return 0;
}
// -----
- Try to compile it (bcc32 -WCV qc71288.cpp)
Exp.: compiles
Act.: E2015 Ambiguity between 'IXMLDocument' and 'Midcomp::IXMLDocument'
Workarounds
None
Attachment
qc71288.zip
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