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 9



>>>>> "Mark" == Mark Johnstone <markj@ibmoto.com> writes:

    Mark> Hello,

    Mark> Here is a small test case that generates in internal
    Mark> compiler error 9.  This test case is a very slight
    Mark> modification on the previous bug I reported a few minutes
    Mark> ago:

    Mark> test.h:

    Mark> #include<iostream.h>

    Mark> struct test_box { void print(void) {cout << "this is a test"
    Mark> << endl;} };

    Mark> void test<class BOX> (test_box *);

    Mark> class test_square { friend void test<class BOX> (test_box
    Mark> *); }

    Mark> test.C:

    Mark> #include "test.h"

    Mark> template <class BOX> void test(BOX *the_box) {
    the_box-> print();
    Mark>     };

    Mark> template void test<> (test_box *);

    Mark> donatello:~/tmp> g++ -c -v -fno-implicit-templates test.C
    Mark> In file included from test.C:1: test.h:12: Internal compiler
    Mark> error 9.  test.h:12: Please submit a full bug report to
    Mark> `egcs-bugs@cygnus.com'.

Patches I have already submitted (but not all of them made it to this
list), cause the following sensible sequence of error messages on this
code:

supernova% test-g++ -c test.cc
test.cc:8: explicit specialization not preceded by `template <>'
test.cc:15: semicolon missing after declaration of `test_square'
test.cc:15: parse error before `template'
test.cc:20: no matching template for `test<>(test_box *)' found

-- 
Mark Mitchell		mmitchell@usa.net
Stanford University	http://www.stanford.edu



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