This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bug using braces with Constructor and Initializing Array Members


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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]