This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Bug using braces with Constructor and Initializing Array Members
- To: egcs-bugs at cygnus dot com
- Subject: Bug using braces with Constructor and Initializing Array Members
- From: Nelson <nelson dot sauve at sympatico dot ca>
- Date: Sat, 18 Jul 1998 13:13:56 -0400
Hello the egcs compiler instructed me to inform you of this error:
class Test
{
public:
Test();
Test( int x );
~Test();
};
int main( )
{
Test* pTestObjects;
pTestObjects = new Test[3] = { { Test( 7 ) },
{ Test( 8 ) },
{ Test( 9 ) }
};
delete [] pTestObjects;
return( 0 );
}
The above causes an internal compiler error - while
int main( )
{
Test* pTestObjects;
pTestObjects = new Test[3] = { Test( 7 ),
Test( 8 ),
Test( 9 )
};
delete [] pTestObjects;
return( 0 );
}
Does not cause the error.
Thanks,
-Nelson