home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.g++.bug
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!me.utoronto.ca!zougas
- From: zougas@me.utoronto.ca (Athanasios(Tom) Zougas)
- Subject: compiler error 15
- Message-ID: <9212291723.AA01638@drill.me.utoronto.ca>
- Sender: gnulists@ai.mit.edu
- Organization: GNUs Not Usenet
- Distribution: gnu
- Date: Tue, 29 Dec 1992 17:23:24 GMT
- Approved: bug-g++@prep.ai.mit.edu
- Lines: 44
-
- I got an internal compiler error 15 with the following code:
-
- ////////////////////////////////////////////////////////////////
- // test.cc
- ////////////////////////////////////////////////////////////////
- #include <iostream.h>
-
- #include "test.h"
-
- int _Test::x = 99;
- int Test<int>::x(88); // <===this caused the error
- // int Test<int>::x = 88; // <===but this was accepted
-
- main()
- {
- Test<int> ti;
- ti.print();
- }
-
- ////////////////////////////////////////////////////////////////
- // test.h
- ////////////////////////////////////////////////////////////////
- #include <iostream.h>
-
- class _Test {
- public:
- _Test() {}
- void print() { cout << x << endl; }
- static int x;
- };
-
- template <class Type>
- class Test : public _Test {
- public:
- void print() { _Test::print(); cout << x << endl; }
- static int x;
- };
-
-
- ===========================================================================
- Tom Zougas zougas@me.utoronto.ca
- Engineering Mechanics and Design Laboratory 416-978-1281
- Dept of Mechanical Engineering, University of Toronto, Toronto, CANADA
-
-