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]

Internal compiler error 980715.


-----BEGIN PGP SIGNED MESSAGE-----

When compiling the following program, an internal compiler error
occured:

 ------------------------- cut here -------------------------
#include <iostream>
#include <algorithm>
#include <deque>
#include <cstring>

class token {
public:
    char  buffer[10];
    token(const char * s) { strncpy(buffer, s, 9); }
    ~token() { }
};

template <class T>
void print_it(const T & t)
{
    cout << t.buffer << endl;
}

int
main()
{
    deque<token> q;

    q.push_back(token("test1"));
    q.push_back(token("test2"));
    q.push_back(token("test3"));
    q.push_back(token("test4"));
    q.push_back(token("test5"));

    for_each(q.begin(), q.end(), print_it<token>);

    return 0;
}
 ------------------------- cut here -------------------------

Here's what happened:

 | simons@petium:/tmp$ g++ --version
 | egcs-2.92.00
 | simons@petium:/tmp$ g++ -W test.cpp -o test
 | test.cpp: In function `int main()':
 | test.cpp:30: Internal compiler error 980715.
 | test.cpp:30: Please submit a full bug report to `egcs-bugs@cygnus.com'.

My machine is a NetBSD/i386 1.3 Unix box.

        -peter

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: latin1

iQCVAwUBNeWwNw9HL1s0103BAQGDOQP/fzOrpK5ql3a/6udMK5uWj6xvZXAks14q
4R4OBSrp99pen/2/0ZrFTfsV5Moqa7aXPbuX8zIYZQjhxaKeCQyU9c5tp/sdmUmC
wH5VxpWW+Qm+iwfHQuf04nIqLlPLA7pCOwONDayfu5gQgROoPxuKGk/YB0nLzWHc
xLawp9GOLJk=
=jm08
-----END PGP SIGNATURE-----


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