Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/C++/Back End    [ Add a report in this area ]  
Report #:  83851   Status: Closed
Value-initialized temporary triggers internal backend error C1798
Project:  C++Builder Build #:  14.0.3615.26342
Version:    14.0 Submitted By:   Niels Dekker
Report Type:  Crash / Data loss / Total failure Date Reported:  4/14/2010 3:00:13 AM
Severity:    Serious / Highly visible problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   275952
Resolution: Fixed (Resolution Comments) Resolved in Build: : 15.0.3778.30296
Duplicate of:  None
Voting and Rating
Overall Rating: (1 Total Rating)
5.00 out of 5
Total Votes: 20
Description
In some cases, the creation of a temporary object causes a compiler crash:

Embarcadero C++ 6.21 for Win32 [...]
Internal backend error C1798 compiling c.cpp(12)
*** 1 errors in Compile ***

The temporary object should have been value-initialized, as it was created by doing T().

I encountered the crash when I tried to compile a test which verifies the implementation of value-initialization for an large number of types. The test is to be included with Boost version 1.44.0, but a preliminary version is already at https://svn.boost.org/svn/boost/trunk/libs/config/test/boost_no_com_value_init.ipp

Attached code:

class user_defined_destructor_holder {
public:
  int i;
  ~user_defined_destructor_holder() {}
};

int main() {
  return user_defined_destructor_holder().i;
}
Steps to Reproduce:
bcc32 -c qc83851
Workarounds
None
Attachment
qc83851.zip
Comments

Niels Dekker at 4/15/2010 4:08:33 AM -
For your information:

Some results of a test that has such a temporary object, user_defined_destructor_holder(), are now at the Boost regression web site:

http://www.boost.org/development/tests/trunk/output/codegear-boost-bin-v2-libs-config-test-config_test-test-borland-cb2009-debug.html
http://www.boost.org/development/tests/trunk/output/codegear-boost-bin-v2-libs-config-test-config_test-test-borland-cb2010-debug.html

Apparently, the old codegear/borland-cb2009 does not have a compile error, while the new codegear/borland-cb2010 has.

According to the Boost website it says:
Fatal F1004 ..\libs\config\test\boost_no_com_value_init.ipp 565: Internal compiler error at 0x451799 with base 0x400000 in function check_value_initialization_of_temporaries()
Fatal F1004 ..\libs\config\test\boost_no_com_value_init.ipp 565: Internal compiler error  in function check_value_initialization_of_temporaries()

The function check_value_initialization_of_temporaries() is in https://svn.boost.org/svn/boost/trunk/libs/config/test/boost_no_com_value_init.ipp

Server Response from: ETNACODE01