🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #1182

compiler error 15

#1182
From: Athanasios(Tom) Zougas
Date: Tue, 29 Dec 1992 17:23
43 lines
1519 bytes
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
Technical Details
Message-ID: <9212291723.AA01638@drill.me.utoronto.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!me.utoronto.ca!zougas

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!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