Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
Compiler
C++
Front End
access
Bitfields
Destructors
Diagnostics
Exception Handling
Extensions
Initialization
Inline Assembly
Invocation
Language
Mangling Scheme
Namespaces
Object Generation
Overloading
Pragmas
Pre-Compiled Headers
Preprocessor
Refactoring
RTTI
Templates
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/Compiler/C++/Front End/Language
[ Add a report in this area ]
Report #:
51623
Status:
Closed
error occurs when result of ?: binded to const reference
Project:
C++Builder
Build #:
10.0.2166.28377
Version:
10.0
Submitted By:
Sergiy Kanilo
Report Type:
Basic functionality failure
Date Reported:
9/5/2007 6:31:59 PM
Severity:
Commonly encountered problem
Last Updated:
3/20/2012 2:24:39 AM
Platform:
All versions
Internal Tracking #:
255266
Resolution:
Fixed
(Resolution Comments)
Resolved in Build:
:
14.0.3483.23033
Duplicate of:
None
Voting and Rating
Overall Rating:
(1 Total Rating)
5.00 out of 5
Total Votes:
10
Description
result of ? A() : A() has type A, which should bind to a A const&,
C++ compiler gives and error when A has explicitely declared constructor and destructor
Steps to Reproduce:
create a console application, type code
struct A
{
A();
~A();
};
int main()
{
A a( 1 ? A() : A() );
}
compilation returns
[C++ Error] Unit1.cpp(17): E2357 Reference initialized with 'A', needs lvalue of type 'A'
[C++ Error] Unit1.cpp(17): E2340 Type mismatch in parameter 1 (wanted 'const A &', got 'A')
note that the error disappeared when declatarion of either A's constructor or destructor is removed
Workarounds
None
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