Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/C++/Front End/Initialization    [ Add a report in this area ]  
Report #:  84279   Status: Closed
Internal compiler error (F1004), value-initializing member function pointer by "new T()"
Project:  C++Builder Build #:  6.21.3615.26516
Version:    14.0 Submitted By:   Niels Dekker
Report Type:  Crash / Data loss / Total failure Date Reported:  5/2/2010 3:36:55 AM
Severity:    Commonly encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   276255
Resolution: Cannot Reproduce (Resolution Comments) Resolved in Build: : 15.0.3833.32158
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
An attempt to value-initialize a heap object by doing new T() triggers an internal compiler error when T is a member function pointer type:

bcc32 c.cpp
Embarcadero C++ 6.21 for Win32 Copyright (c) 1993-2009 Embarcadero Technologies, Inc.
c.cpp:
Fatal F1004 c.cpp 7: Internal compiler error at 0x4a4cd4 with base 0x400000 in function main()
Fatal F1004 c.cpp 7: Internal compiler error in function main()

Note: This crash was encountered during the development of a value-initialization test, which is to be added to Boost Config: https://svn.boost.org/svn/boost/trunk/libs/config/test/boost_no_com_value_init.ipp
Steps to Reproduce:
class incomplete_class;
typedef int (incomplete_class::*member_function_ptr_type)(int);

int main()
{
  // Triggers internal compiler error:
  new member_function_ptr_type();
}
Workarounds
None
Attachment
None
Comments

Tomohiro Takahashi at 5/2/2010 6:10:36 PM -
Same error occurs with old versions of C++Builder(e.g., BCB6).

Server Response from: ETNACODE01